From: David Smith <dsmith@redhat.com>
To: Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com>
Cc: systemtap@sources.redhat.com
Subject: Re: [PATCH] Tracepoint Tapset for Memory Subsystem
Date: Tue, 22 Sep 2009 17:39:00 -0000 [thread overview]
Message-ID: <4AB90BE0.4030405@redhat.com> (raw)
In-Reply-To: <20090919050102.GA3767@rajduddu>
On 09/19/2009 12:01 AM, Rajasekhar Duddu wrote:
> Hi all,
> here I am posting a patch for Memory Tapset based on
> kernel Tracepoints.
>
> This patch adds tracepoint tapset to memory.stp and a testcase
> (mem_tracepoints.stp) which tests if all probes in the
> tapset are resolvable .
In general this looks reasonable, and thanks for including the testcase.
One comment below.
>
>
> Signed-off-by: Rajasekhar Duddu <rajduddu@linux.vnet.ibm.com>
> diff -rupaN a/tapset/memory.stp b/tapset/memory.stp
> --- a/tapset/memory.stp 2009-09-16 14:24:21.000000000 +0200
> +++ b/tapset/memory.stp 2009-09-19 06:33:34.000000000 +0200
> @@ -195,3 +195,132 @@ probe vm.brk = kernel.function("do_brk")
> probe vm.oom_kill = kernel.function("__oom_kill_task") {
> task = $p
> }
> +
> +
> +/*Function to convert the GFP_FLAGS .*/
> +function gfp_f:string (gfp_flag:long)
> +%{
> + switch (THIS->gfp_flag) {
> + case 32:
> + strlcpy(THIS->__retvalue, "GFP_ATOMIC", MAXSTRINGLEN);
> + break;
> + case 208:
> + strlcpy(THIS->__retvalue, "GFP_KERNEL", MAXSTRINGLEN);
> + break;
> + case 16:
> + strlcpy(THIS->__retvalue, "GFP_NOIO", MAXSTRINGLEN);
> + break;
> + case 80:
> + strlcpy(THIS->__retvalue, "GFP_NOFS", MAXSTRINGLEN);
> + break;
> + case 524496:
> + strlcpy(THIS->__retvalue, "GFP_TEMPORARY", MAXSTRINGLEN);
> + break;
> + case 8400:
> + strlcpy(THIS->__retvalue, "GFP_USER", MAXSTRINGLEN);
> + break;
> + case 8402:
> + strlcpy(THIS->__retvalue, "GFP_HIGHUSER", MAXSTRINGLEN);
> + break;
> + case 8410:
> + strlcpy(THIS->__retvalue, "GFP_HIGHUSER_MOVABLE", MAXSTRINGLEN);
> + break;
> + default:
> + break;
> + }
> +
> +%}
Hmm. Have you tried something like this instead (to avoid the hardcoded
constants)? Note that I haven't actually tried this...
====
%{
#include <linux/gfp.h>
%}
function gfp_f:string (gfp_flag:long)
%{
switch (THIS->gfp_flag) {
case GFP_ATOMIC:
strlcpy(THIS->__retvalue, "GFP_ATOMIC", MAXSTRINGLEN);
break;
case GFP_KERNEL:
strlcpy(THIS->__retvalue, "GFP_KERNEL", MAXSTRINGLEN);
break;
...
%}
====
--
David Smith
dsmith@redhat.com
Red Hat
http://www.redhat.com
256.217.0141 (direct)
256.837.0057 (fax)
next prev parent reply other threads:[~2009-09-22 17:39 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-19 5:01 Rajasekhar Duddu
2009-09-22 17:39 ` David Smith [this message]
2009-09-22 21:23 ` Frank Ch. Eigler
2009-09-22 22:05 ` David Smith
2009-09-24 18:08 ` [PATCH v2] " Rajasekhar Duddu
2009-09-25 19:19 ` David Smith
2009-09-25 20:07 ` Frank Ch. Eigler
2009-09-28 18:12 ` Jim Keniston
2009-09-29 8:58 ` K.Prasad
2009-09-25 21:50 ` Josh Stone
2009-09-30 10:12 ` Rajasekhar Duddu
2009-10-02 15:14 ` [PATCH v3] " Rajasekhar Duddu
2009-10-06 19:01 ` Frank Ch. Eigler
2009-10-07 13:07 ` Rajasekhar Duddu
2009-10-07 19:51 ` Frank Ch. Eigler
2009-10-09 17:08 ` Rajasekhar Duddu
2009-10-09 17:38 ` Frank Ch. Eigler
2009-10-14 8:32 ` Rajasekhar Duddu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4AB90BE0.4030405@redhat.com \
--to=dsmith@redhat.com \
--cc=rajduddu@linux.vnet.ibm.com \
--cc=systemtap@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).