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: Wed, 6 Nov 2024 16:23:42 -0500	[thread overview]
Message-ID: <20241106162342.3c44a8e9@gandalf.local.home> (raw)
In-Reply-To: <ZyuxmsK0jfKa7NKK@elver.google.com>

On Wed, 6 Nov 2024 19:12:42 +0100
Marco Elver <elver@google.com> wrote:

> No other events should be traced. This is the test program I've used:
> 
> 	#include <sys/prctl.h>
> 	#include <unistd.h>
> 
> 	int main(int argc, char *argv[])
> 	{
> 	  prctl(1234, 101, 102, 103, 104);
> 	  if (argc > 1)
> 	    usleep(1000);
> 	  return 0;
> 	}
> 
> Kernel config is x86_64 default + CONFIG_FUNCTION_TRACER=y +
> CONFIG_FTRACE_SYSCALLS=y. For the test, once booted all I do is:
> 
> 	% echo 1 > /sys/kernel/debug/tracing/events/task/task_prctl_unknown/enable
> 	% cat /sys/kernel/debug/tracing/trace_pipe
> 	... wait for output ...
> 
> That's pretty much it. I've attached my kernel config just in case I
> missed something.

OK, it's because you are using trace_pipe (which by the way should not be
used for anything serious). The read of trace_pipe flushes the buffer
before the task is scheduled out and the comm saved, so it prints the
"<...>". If you instead do the cat of trace_pipe *after* running the
command, you'll see the comm.

So this is just because you are using the obsolete trace_pipe.

-- Steve

  reply	other threads:[~2024-11-06 21:23 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
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 [this message]
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=20241106162342.3c44a8e9@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