Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1415821

Re: [PATCH v2 3/3] tracing: make "string" the default type for [ku]probe event $comm

From Masami Hiramatsu <mhiramat@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 3/3] tracing: make "string" the default type for [ku]probe event $comm
Date 2016-06-07 10:10 +0200
Message-ID <rHkff-6M-15@gated-at.bofh.it> (permalink)
References <rFLWh-52J-1@gated-at.bofh.it> <rFLWh-52J-17@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu,  2 Jun 2016 18:11:03 -0700
Omar Sandoval <osandov@osandov.com> wrote:

> From: Omar Sandoval <osandov@fb.com>
> 
> You'd only ever want $comm as a string, but the default is still u64.
> Push the type parsing later so we can decide based on the actual
> fetcharg and make "string" the default for $comm.

Hmm, at this moment, I'd rather like a small hack in 
traceprobe_parse_probe_arg() as like below:

--- a/kernel/trace/trace_probe.c
+++ b/kernel/trace/trace_probe.c
@@ -522,6 +522,12 @@ int traceprobe_parse_probe_arg(char *arg, ssize_t *size,
                arg[t - parg->comm] = '\0';
                t++;
        }
+       /*
+        * The default type of "$comm" should be a string, and it must not
+        * be dereferred
+        */
+       if (!t && strcmp("$comm", arg))
+               t = "string";
        parg->type = find_fetch_type(t, ftbl);
        if (!parg->type) {
                pr_info("Unsupported type: %s\n", t);

This is not general, but easy to review :)

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/3] tracing: expose current->comm to [ku]probe events Omar Sandoval <osandov@osandov.com> - 2016-06-03 03:20 +0200
  [PATCH v2 1/3] tracing: document "string_size" [ku]probe type Omar Sandoval <osandov@osandov.com> - 2016-06-03 03:20 +0200
    Re: [PATCH v2 1/3] tracing: document "string_size" [ku]probe type Masami Hiramatsu <mhiramat@kernel.org> - 2016-06-07 08:30 +0200
  [PATCH v2 2/3] tracing: expose current->comm to [ku]probe events Omar Sandoval <osandov@osandov.com> - 2016-06-03 03:20 +0200
    Re: [PATCH v2 2/3] tracing: expose current->comm to [ku]probe  events Masami Hiramatsu <mhiramat@kernel.org> - 2016-06-07 09:30 +0200
      Re: [PATCH v2 2/3] tracing: expose current->comm to [ku]probe events Namhyung Kim <namhyung@kernel.org> - 2016-06-07 15:50 +0200
  [PATCH v2 3/3] tracing: make "string" the default type for [ku]probe event $comm Omar Sandoval <osandov@osandov.com> - 2016-06-03 03:20 +0200
    Re: [PATCH v2 3/3] tracing: make "string" the default type for  [ku]probe event $comm Masami Hiramatsu <mhiramat@kernel.org> - 2016-06-07 10:10 +0200
      Re: [PATCH v2 3/3] tracing: make "string" the default type for  [ku]probe event $comm Namhyung Kim <namhyung@kernel.org> - 2016-06-07 15:50 +0200
        Re: [PATCH v2 3/3] tracing: make "string" the default type for  [ku]probe event $comm Steven Rostedt <rostedt@goodmis.org> - 2016-06-08 15:50 +0200

csiph-web