This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V4] Tracepoint Tapset for Memory Subsystem


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]