Linux Trace Kernel
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Marco Elver <elver@google.com>
Cc: Kees Cook <keescook@chromium.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oleg Nesterov <oleg@redhat.com>,
	linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org,
	Dmitry Vyukov <dvyukov@google.com>,
	kasan-dev@googlegroups.com
Subject: Re: [PATCH] tracing: Add task_prctl_unknown tracepoint
Date: Tue, 5 Nov 2024 12:02:47 -0500	[thread overview]
Message-ID: <20241105120247.596a0dc9@gandalf.local.home> (raw)
In-Reply-To: <CANpmjNMuTdLDMmSeJkHmGjr59OtMEsf4+Emkr8hWD++XjQpSpg@mail.gmail.com>

On Tue, 5 Nov 2024 17:53:53 +0100
Marco Elver <elver@google.com> wrote:

> > > +/**
> > > + * task_prctl_unknown - called on unknown prctl() option
> > > + * @task:    pointer to the current task
> > > + * @option:  option passed
> > > + * @arg2:    arg2 passed
> > > + * @arg3:    arg3 passed
> > > + * @arg4:    arg4 passed
> > > + * @arg5:    arg5 passed
> > > + *
> > > + * Called on an unknown prctl() option.
> > > + */
> > > +TRACE_EVENT(task_prctl_unknown,
> > > +
> > > +     TP_PROTO(struct task_struct *task, int option, unsigned long arg2, unsigned long arg3,
> > > +              unsigned long arg4, unsigned long arg5),
> > > +
> > > +     TP_ARGS(task, option, arg2, arg3, arg4, arg5),
> > > +
> > > +     TP_STRUCT__entry(
> > > +             __field(        pid_t,          pid             )  
> >
> > Why record the pid that is already recorded by the event header?  
> 
> To keep in style with the other "task" tracepoints above. I can
> certainly do without - it does seem unnecessary.

Hmm, new_task, pid is different than the creator. But rename is pointless
to record pid. I would get rid of it here, especially since it also creates
a hole in the event (three int fields followed by a long).

> 
> To cleanup, do we want to remove "pid=" from the other tracepoints in
> this file as well (in another patch). Or does this potentially break
> existing users?

We can't from task_newtask as that's the pid of the task that's being
created. In other words, it's very relevant. The task_rename could have its
pid field dropped.

> 
> > > +             __string(       comm,           task->comm      )  
> >
> > I'm also surprised that the comm didn't show in the trace_pipe.  
> 
> Any config options or tweaks needed to get it to show more reliably?
> 
> > I've
> > updated the code so that it should usually find it. But saving it here may
> > not be a big deal.  

How did you start it? Because it appears reliable for me.

-- Steve

  reply	other threads:[~2024-11-05 17:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-05 13:34 [PATCH] tracing: Add task_prctl_unknown tracepoint Marco Elver
2024-11-05 16:31 ` Steven Rostedt
2024-11-05 16:53   ` Marco Elver
2024-11-05 17:02     ` Steven Rostedt [this message]
2024-11-05 17:22       ` Marco Elver
2024-11-06  9:22         ` Marco Elver
2024-11-06 15:18           ` Steven Rostedt
2024-11-06 15:28             ` Steven Rostedt
2024-11-06 18:12               ` Marco Elver
2024-11-06 21:23                 ` Steven Rostedt
2024-11-06 21:59                   ` Marco Elver
2024-11-06 22:30                     ` 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=20241105120247.596a0dc9@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=oleg@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