This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH v2] Tracepoint Tapset for Memory Subsystem
On 09/24/2009 11:08 AM, Rajasekhar Duddu wrote:
>
> Hi, I have modified the patch according to the comments passed
> by Frank and David.
>
> Many thanks to Frank And David.
>
> Changelog:
> Removed the Hardcoded constants in converting GFPFLAGS.
> Added a kprobe based fallback probe to kfree.
Why is kfree the only one you're adding with a kprobe fallback? This is
a good feature to have!
> +/**
> + * probe kmem.kfree - Fires when <command>kfree</comand> is requested.
> + * @call_site: Address of the function calling this kmemory function.
> + * @ptr: Pointer to the kmemory allocated which is returned by kmalloc
> + */
> +probe kmem.kfree.kp = kernel.function("kfree") {
> + name = "kfree"
> + call_site = symname(call_site())
> + ptr = $x
> +}
> +
> +probe kmem.kfree.tp = kernel.trace("kfree") {
> + name = "kfree"
> + call_site = symname($call_site)
> + ptr = $ptr
> +}
> +
> +probe kmem.kfree = kmem.kfree.tp !,
> + kmem.kfree.kp
> +{}
Please use an underscored prefix (e.g. __kmem) for internal details that
the user isn't meant to use directly, like the .tp/.kp branches.
I'd also like to see a consistent prefix in this tapset. The existing
probe points in memory.stp are all vm.*, so it's probably best to stick
with that.
Thanks,
Josh