From owner-freebsd-dtrace@FreeBSD.ORG Thu Jun 18 00:24:10 2015 Return-Path: Delivered-To: freebsd-dtrace@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id C280DC2 for ; Thu, 18 Jun 2015 00:24:10 +0000 (UTC) (envelope-from rm@joyent.com) Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) (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 9B24A75F for ; Thu, 18 Jun 2015 00:24:10 +0000 (UTC) (envelope-from rm@joyent.com) Received: by pacyx8 with SMTP id yx8so47863893pac.2 for ; Wed, 17 Jun 2015 17:24:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=SkEcnpfVaASiG4KZPQ5nx7rSck6lBCviYJzLCuO1BxA=; b=JzVRwSeXjX1kPcYA3k6otIyTAJyrb9IxidI+qqEl4j4DsEHbZu5FqvBKEN2bV4XUCo s0LMYaHrBjiwG4qcR7QeselYQqmI7N782l0qJnRpMihocq5o7oi959MWC/vLUBEThhEg lEg1VVmaiPkqPLMRWOePJD3r9oyPTQSCbysbNwKaclhPxjIv80HzuTJ8HJ2HtKXedpSH OlM3BQGWuWuZTCM1n2xi0XgcUuJWn7JoqQnrOLNOtCigzS4/Jyy/NnzsXlsCn4M3ga7O JV4GetPhRQJ1QSgMIEWqSjGn+1VoLmfThCVWAuv7YmduO5mxjjIcUvHa9U5Z/vzHM4Ee d8BQ== X-Gm-Message-State: ALoCoQnfHRVji5kQfiLsz7s1HwTPgSRHlxR5uYvyA4Y/1BZcaNo0/iSl0QkU3Qn6KJVkjVdV8oDx X-Received: by 10.66.249.101 with SMTP id yt5mr15866876pac.116.1434587044338; Wed, 17 Jun 2015 17:24:04 -0700 (PDT) Received: from zanarkand.local ([208.184.5.170]) by mx.google.com with ESMTPSA id f1sm5965916pdp.24.2015.06.17.17.24.01 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 17:24:02 -0700 (PDT) Message-ID: <55820FA0.7090507@joyent.com> Date: Wed, 17 Jun 2015 17:24:00 -0700 From: Robert Mustacchi User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: freebsd-dtrace@freebsd.org Subject: Re: Quantize a probe only if it has a particular function in its stack. References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-dtrace@freebsd.org X-Mailman-Version: 2.1.20 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: Thu, 18 Jun 2015 00:24:10 -0000 On 6/17/15 17:21 , Priyank Sanghavi wrote: > Hello, > > I am currently working on dtrace on free-bsd. What I want to do is put a probe on uma_zalloc function and quantize its arguments. But along with that I want to keep a condition to quantize ( or record the readings) only if the stack of that uma_zalloc has a function ( foo ) in it. —— This means, consider the readings of uma_zalloc only if it has come from the function foo. > > Is there a condition that can do that work? Just use a thread local variable that tracks when you enter the function you care about and removes it when you return. eg. if you had a function called foobar: fbt::foobar:entry { self->t = 1; } fbt::foobar:return { self->t = 0; } Then you can use that as a predicate on an enabling of uma_zalloc. Robert