This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH V4] Tracepoint Tapset for Memory Subsystem
- From: fche at redhat dot com (Frank Ch. Eigler)
- To: Rajasekhar Duddu <rajduddu at linux dot vnet dot ibm dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Mon, 30 Nov 2009 11:26:18 -0500
- Subject: Re: [PATCH V4] Tracepoint Tapset for Memory Subsystem
- References: <20091125093051.GA13363@rajduddu>
Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com> writes:
> [...]
> +%{
> +#define __GFP_BITMASKS(FLAG) if(gfp_flag & FLAG) { if(THIS->__retvalue[0] != '\0') \
> + strlcat(THIS->__retvalue, " | "#FLAG, MAXSTRINGLEN); \
> + else strlcat(THIS->__retvalue, #FLAG, MAXSTRINGLEN); }
> +%}
> +%{
> +#define __GFP_COMPOSITE_FLAG(FLAG) if(gfp_flag == FLAG) { \
> + strlcat(THIS->__retvalue, #FLAG, MAXSTRINGLEN); return; }
> +%}
These should be defined within the embedded-c function block below,
and should be #undef'd there too, to avoid polluting the namespace.
>[...]
> --- a/testsuite/systemtap.examples/memory/vm.tracepoints.stp 1969-12-31 19:00:00.000000000 -0500
> +++ b/testsuite/systemtap.examples/memory/vm.tracepoints.stp 2009-11-25 04:06:21.000000000 -0500
> @@ -0,0 +1,18 @@
> +global slabs
> +
> +probe vm.kmem_cache_alloc {
> + slabs [execname(), bytes_req]++
> +}
> +
> +probe timer.ms(10000)
> +{
> + dummy = "";
> + foreach ([name, bytes] in slabs) {
> + if (dummy != name)
> + printf("\nProcess:%s\n", name);
> + printf("Slab_size:%d\tCount:%d\n", bytes, slabs[name, bytes]);
> + dummy = name;
> + }
> + delete slabs
> + printf("\n-------------------------------------------------------\n\n")
> +}
As a matter of style, this would be nearly equivalent to all of that,
except for reporting once at the end rather than every 10 seconds.
global slabs
probe vm.kmem_cache_alloc {
slabs [execname(), bytes_req]<<<1
}
Please confirm that the tapset reference documentation template is
configured to extract the @@doc stuff from the tapset.
Please add a sentence to NEWS to describe the new tapset. (Others
who recently added tapset extensions should do the same!)
Please commit with those changes.
- FChE