All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Tom Zanussi <zanussi@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH v2 2/2] tracing: Allow execnames to be passed as args for synthetic events
Date: Fri, 23 Jul 2021 10:11:33 +0900	[thread overview]
Message-ID: <20210723101133.3378369c618c53f2e71d3e4c@kernel.org> (raw)
In-Reply-To: <20210722123234.636d5363@oasis.local.home>

On Thu, 22 Jul 2021 12:32:34 -0400
Steven Rostedt <rostedt@goodmis.org> wrote:

> On Fri, 23 Jul 2021 01:19:35 +0900
> Masami Hiramatsu <mhiramat@kernel.org> wrote:
> 
> > > +/* Convert a var that points to common_pid.execname to a string */
> > > +static void update_var_execname(struct hist_field *hist_field)
> > > +{
> > > +	hist_field->flags = HIST_FIELD_FL_STRING | HIST_FIELD_FL_VAR |
> > > +		HIST_FIELD_FL_EXECNAME;
> > > +	hist_field->size = MAX_FILTER_STR_VAL;
> > > +	hist_field->is_signed = 0;
> > > +
> > > +	kfree_const(hist_field->type);
> > > +	hist_field->type = "char[]";
> > > +
> > > +	hist_field->fn = hist_field_execname;
> > > +}  
> > 
> > Hmm, this is a bit ad-hoc.
> > 
> > Can't this be done in the create_hist_field()? If you check 'var_name' and
> > flags & HIST_FIELD_FL_EXECNAME, you can do the same thing I think.
> 
> Hi Masami,
> 
> I originally tried that, but then found that it converted the pid over
> to it as well. So this must be done only for vars, and not only that, it
> needs to be done in a single place, because I was spending hours
> debugging it.

I understand. As far as I can see the code, it looks a bit complicated.
To simplify it, I need to understand the spec for "hist_field"
for keys and for vars. And maybe need to split both case.

> I found this to be the least intrusive solution.
> 
> Maybe Tom has a better idea, but I don't have any more time to work on
> it, and I really want this feature for the next merge window.
> 
> If you can make it work, and have time to play with it, I'm happy to
> take an alternative :-)

Me neither at least this moment, need more investigation. Let me try.

Thank you,

-- 
Masami Hiramatsu <mhiramat@kernel.org>

  reply	other threads:[~2021-07-23  1:11 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-22 14:27 [PATCH v2 0/2] tracing: Allow execnames to be passed as args for synthetic events Steven Rostedt
2021-07-22 14:27 ` [PATCH v2 1/2] tracing: Have histogram types be constant when possible Steven Rostedt
2021-07-22 15:24   ` Masami Hiramatsu
2021-07-22 22:11   ` Tom Zanussi
2021-07-22 14:27 ` [PATCH v2 2/2] tracing: Allow execnames to be passed as args for synthetic events Steven Rostedt
2021-07-22 16:19   ` Masami Hiramatsu
2021-07-22 16:32     ` Steven Rostedt
2021-07-23  1:11       ` Masami Hiramatsu [this message]
2021-07-23  1:22         ` Masami Hiramatsu
2021-07-23  1:26           ` Steven Rostedt
2021-07-23  1:24         ` Steven Rostedt
2021-07-24 10:31           ` Masami Hiramatsu
2021-07-25  2:18             ` Masami Hiramatsu
2021-07-25  3:45               ` Masami Hiramatsu
2021-07-26 13:28                 ` Steven Rostedt
2021-07-27 22:54                   ` Masami Hiramatsu
2021-07-22 22:09   ` Tom Zanussi
2021-07-22 15:14 ` [PATCH v2 0/2] " Steven Rostedt

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=20210723101133.3378369c618c53f2e71d3e4c@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=zanussi@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.