Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jun 2015 17:24:00 -0700
From:      Robert Mustacchi <rm@joyent.com>
To:        freebsd-dtrace@freebsd.org
Subject:   Re: Quantize a probe only if it has a particular function in its stack.
Message-ID:  <55820FA0.7090507@joyent.com>
In-Reply-To: <ED346F16-DE50-4706-A8B9-89A7764649DD@gmail.com>
References:  <ED346F16-DE50-4706-A8B9-89A7764649DD@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?55820FA0.7090507>