Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1382826
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [RFC][PATCH 3/4] tracing: Add infrastructure to allow set_event_pid to follow children |
| Date | Tue, 19 Apr 2016 22:40:01 +0200 |
| Message-ID | <rpKBb-4bP-3@gated-at.bofh.it> (permalink) |
| References | <rpEYO-8k2-19@gated-at.bofh.it> <rpEYO-8k2-17@gated-at.bofh.it> <rpHaj-1sn-41@gated-at.bofh.it> <rpHtF-1RO-31@gated-at.bofh.it> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Originating-IP | [78.47.125.74] |
| X-Mailer | Zimbra 8.6.0_GA_1178 (ZimbraWebClient - FF45 (Linux)/8.6.0_GA_1178) |
| Thread-Topic | tracing: Add infrastructure to allow set_event_pid to follow children |
| Thread-Index | BsXwXbNM0jHKG8lnz9m8E5Vm9ZgaUQ== |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 58 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, Ingo Molnar <mingo@kernel.org>, Andrew Morton <akpm@linux-foundation.org>, "H. Peter Anvin" <hpa@zytor.com>, Thomas Gleixner <tglx@linutronix.de>, Jiri Olsa <jolsa@kernel.org>, Masami Hiramatsu <mhiramat@kernel.org>, Namhyung Kim <namhyung@kernel.org>, linux-trace-users@vger.kernel.org |
| X-Original-Date | Tue, 19 Apr 2016 20:30:07 +0000 (UTC) |
| X-Original-Message-ID | <1646895533.63372.1461097807190.JavaMail.zimbra@efficios.com> |
| X-Original-References | <20160419143421.829909157@goodmis.org> <20160419143725.473997738@goodmis.org> <1887707510.62932.1461084911586.JavaMail.zimbra@efficios.com> <20160419131307.6e32f9f0@gandalf.local.home> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1382826 |
Show key headers only | View raw
----- On Apr 19, 2016, at 1:13 PM, rostedt rostedt@goodmis.org wrote: > On Tue, 19 Apr 2016 16:55:11 +0000 (UTC) > Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > >> ----- On Apr 19, 2016, at 10:34 AM, rostedt rostedt@goodmis.org wrote: >> >> > From: Steven Rostedt <rostedt@goodmis.org> >> > >> > Add the infrastructure needed to have the PIDs in set_event_pid to >> > automatically add PIDs of the children of the tasks that have their PIDs in >> > set_event_pid. This will also remove PIDs from set_event_pid when a task >> > exits >> > >> > This is implemented by adding hooks into the fork and exit tracepoints. On >> > fork, the PIDs are added to the list, and on exit, they are removed. >> > >> > Add a new option called event_fork that when set, PIDs in set_event_pid will >> > automatically get their children PIDs added when they fork, as well as any >> > task that exits will have its PID removed from set_event_pid. >> >> Just out of curiosity: how does it deal with multi-process and multi-thread ? >> What events are expected in each case ? >> > > Not sure what you mean by that. This is in-kernel, and it's simply > tasks. That is, any task (process or thread) that creates another task > has its kernel pid checked. That would be the thread ID as well. So it > works the same with processes as with threads because within the kernel > they are just all just "tasks". You register on sched_process_fork and sched_process_exit tracepoints for adding/removing PIDs to/from your "PID tracker". sched_process_fork() is called both when a process and when a thread is created. sched_process_exit() is called from do_exit(). Ah! and it seems do_exit is called whenever a user-space thread exits. The process exiting system call is rather exit_group(2). I was concerned that you might miss the thread exiting system calls, but it seems OK after digging back into that part of the kernel source code. It's been a while since last time I had to do modeling of the kernel state based on events by myself, sorry about the confusion. :-) Thanks, Mathieu > > -- Steve -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[RFC][PATCH 3/4] tracing: Add infrastructure to allow set_event_pid to follow children Steven Rostedt <rostedt@goodmis.org> - 2016-04-19 16:40 +0200
Re: [RFC][PATCH 3/4] tracing: Add infrastructure to allow set_event_pid to follow children Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-19 19:00 +0200
Re: [RFC][PATCH 3/4] tracing: Add infrastructure to allow set_event_pid to follow children Steven Rostedt <rostedt@goodmis.org> - 2016-04-19 19:20 +0200
Re: [RFC][PATCH 3/4] tracing: Add infrastructure to allow set_event_pid to follow children Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2016-04-19 22:40 +0200
csiph-web