From owner-freebsd-hackers@freebsd.org Wed Apr 12 00:10:58 2017 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB73CD3A509 for ; Wed, 12 Apr 2017 00:10:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mailman.ysv.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 9BB3CBD0 for ; Wed, 12 Apr 2017 00:10:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mailman.ysv.freebsd.org (Postfix) id 98005D3A508; Wed, 12 Apr 2017 00:10:58 +0000 (UTC) Delivered-To: hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 979D4D3A507 for ; Wed, 12 Apr 2017 00:10:58 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-ua0-f176.google.com (mail-ua0-f176.google.com [209.85.217.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5B4E2BCF for ; Wed, 12 Apr 2017 00:10:57 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-ua0-f176.google.com with SMTP id q26so7748926uaa.0 for ; Tue, 11 Apr 2017 17:10:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=13A4uRpsv4+eJqty5OBONh8XJhB+haky4HDmP7qTYn4=; b=d5PkPFbrnmO6naA0+o6+D3RMyViH1UCdwk7sZM3YxRDBGVzbrlpac/OYByhMUqBjQz RoJcgGC6yx4rNKhi194NwpdNoFYgbnnRGX5FjUD9/vW0JL32lvVbkFV1ygrlETC7QKgE JPPR0W5i91RHEeumPVnZ4NK6Qgts1Owe5h7nc0aVpFLGrp0oyxc2zzeuF9gA34ZY858p FH9fdV9n0gtz+ZJY7Ct5lMCXbYDqY2NuvYcGmC7buS9JsY2L2My7u6wpOsxe17KI+BIs I6J2Pi9bdRE7FhlEIH63Z9CwiklL9vlQfx+e3p1p0WquhZ4o0pSljeyjcehIV8H0AvbX Gygw== X-Gm-Message-State: AN3rC/4120Bn8fwi/JDZCCCPYRXjLyU/BKt8FVtGi6FKFpqihPoL47PJ61OEU9ueFt3t9Q== X-Received: by 10.176.80.65 with SMTP id z1mr122700uaz.99.1491954434998; Tue, 11 Apr 2017 16:47:14 -0700 (PDT) Received: from mail-ua0-f169.google.com (mail-ua0-f169.google.com. [209.85.217.169]) by smtp.gmail.com with ESMTPSA id 21sm4824243vkg.38.2017.04.11.16.47.14 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 16:47:14 -0700 (PDT) Received: by mail-ua0-f169.google.com with SMTP id u103so7508393uau.1 for ; Tue, 11 Apr 2017 16:47:14 -0700 (PDT) X-Received: by 10.159.32.163 with SMTP id 32mr139999uaa.160.1491954434017; Tue, 11 Apr 2017 16:47:14 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.103.13.3 with HTTP; Tue, 11 Apr 2017 16:47:13 -0700 (PDT) In-Reply-To: References: From: Conrad Meyer Date: Tue, 11 Apr 2017 16:47:13 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Dtrace oddity To: Christopher Bowman Cc: "freebsd-hackers@freebsd.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Apr 2017 00:10:58 -0000 On Tue, Apr 11, 2017 at 12:16 AM, Christopher Bowman wrote: > Here is the oddity: when I run Dtrace and then run my test program I get the following output from Dtrace: > > crb@retread:60> dtrace -n 'syscall:freebsd:mmap:entry /execname == "test"/ {}' > dtrace: description 'syscall:freebsd:mmap:entry ' matched 1 probe > CPU ID FUNCTION:NAME > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > 0 63401 mmap:entry > > I think Dtrace is indicating that the mmap syscall was called 12 times by my test program yet I can see how the program below would have done that. A configuration file for dynamic linking is mapped; libc needs to be mapped (several different regions); jemalloc sets up some memory for allocations with anonymous mmap. So this is not unreasonable as part of crt0 / program startup. Best, Conrad