From owner-freebsd-dtrace@freebsd.org Mon Jun 18 23:43:05 2018 Return-Path: Delivered-To: freebsd-dtrace@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4C31006502 for ; Mon, 18 Jun 2018 23:43:05 +0000 (UTC) (envelope-from ashfixit@gmail.com) Received: from mail-yw0-x22f.google.com (mail-yw0-x22f.google.com [IPv6:2607:f8b0:4002:c05::22f]) (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 123D77A258 for ; Mon, 18 Jun 2018 23:43:05 +0000 (UTC) (envelope-from ashfixit@gmail.com) Received: by mail-yw0-x22f.google.com with SMTP id p129-v6so6258862ywg.7 for ; Mon, 18 Jun 2018 16:43:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=cGZ7sLsxVG8Ce/aGXWoPjqnUy0ATBbhu+XgdiHZDGa0=; b=KJd+6oO4Ku/kYQwu2BQFhUWhESmhKO1917NLmq1JY79Zbr0azevcAEv+lnrTNvgPaA d623a478OZk4LPnw83S3hnT8OBuKeYmr1pwKNnrwjh/ERQ3N+kJvoGdCMaSjQ68FQN6Z HFHM08a9lzdxPm2LBY/n6GawfkFn4CqGoC//kAVpCMHv3LONOMojiaIV7opWByohKMui hTyFO4B1lnM36Nb4LgSUZHRnJJu22OIleEIa03/f36CAtQnR87Q/KS37lhhDqfCTGvM4 ArOIcCHbPnPk4L2AhLMzpKX7zIKTBgzCoha/A/+A6bpIl0nPASZMY082W1ObLoLv/VXa bOuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=cGZ7sLsxVG8Ce/aGXWoPjqnUy0ATBbhu+XgdiHZDGa0=; b=ub42azbAdjRS3GnkMMuZCt/GMRz92tW0Z4/g3etNVNCZ+Z7KUvZNUDxQTtmSfMGL6U wGZSo7le9X8cjckgpyHzEQ07xzCQ3GyfAAT5WlEYAO36CCp+5CzeQezuNNKAKOZXNAbJ DcHJK5xU5n2rsBzN7AfwzOtAVsUYObW6gC6mAx7Cqzb3n30i0EWNvMLnEF5oeSWmJYbX lg3ZFhkSxccpXG4E4lhstPNalC38cCkm/oZj1rzwuumcqRc+OYiTI1ZOZ2yFhc+fTgX3 I8/6DnHqWPUJqlVB6F37vmx6IQTusM7lTECt/H4nxe+q9Cj910yPPxbE+qSMk6oBXRoL 6qRA== X-Gm-Message-State: APt69E2CyuSRsVeGHRgVMDwcSjxXBQD+J4R1hab1nmIr0yuRYcATTn4k TkrPKcXJss+LWAUr18/5BukBWnQ/8msInFl/cfEAaA== X-Google-Smtp-Source: ADUXVKIDLW9CPRNZZv1vrXhipH/ejL3+YPqUj+/DRtpe8VABInEKfCetfBSpeSlbxXEBvYOkPiLWR3M5y26ojTdeoOA= X-Received: by 2002:a81:f95:: with SMTP id 143-v6mr7097296ywp.93.1529365383881; Mon, 18 Jun 2018 16:43:03 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a0d:d7c9:0:0:0:0:0 with HTTP; Mon, 18 Jun 2018 16:43:03 -0700 (PDT) In-Reply-To: References: <1529348905.2613088.1412091424.2D14994E@webmail.messagingengine.com> From: Ash Gokhale Date: Mon, 18 Jun 2018 19:43:03 -0400 Message-ID: Subject: Re: where did FreeBSD 11's syscall::lstat go? where do syscall probes get defined? To: Ryan Stone Cc: Dave Cottlehuber , freebsd-dtrace@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.26 X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "A discussion list for developers working on DTrace in FreeBSD." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Jun 2018 23:43:05 -0000 On Mon, Jun 18, 2018 at 3:15 PM, Ryan Stone wrote: > The syscall probes are automatically defined based off of the > syscalls.master file. As a part of ino64, it seems that lstat() was > retired as a system call. As you can see in lstat.c, lstat(3) is now > implemented in terms of fstatat(2), so that's what new scripts should > be used. > > You can also see that syscalls.master defines a compat11 version of > lstat(), as this is necessary to maintain binary compatibility with > pre-12.0 binaries. > _______________________________________________ > freebsd-dtrace@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-dtrace > To unsubscribe, send any mail to "freebsd-dtrace-unsubscribe@freebsd.org" > Looks like lstat probe can hit as part of libc, pid provider, But unfortunately now you need to pretarget a process . #dtrace -p `pgrep foo` -ln 'pid$target::lstat*:entry { }' ID PROVIDER MODULE FUNCTION NAME 57364 pid33074 libc.so.7 lstat entry To understand the rework; grab all the syscalls and look for patterns that explain the program behaviour. syscall:::entry /execname =="wahtever"/ { @[probefunc]=count () ;}' This is an example of the principle that dtrace scripts are bespoke; writing them to be portable is not generally easy. The notion of probe stability classes attempts to answer for the need for durable interfaces, but automatically generated probes are going to fool us.