Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-22 Thread Steven Rostedt
On Fri, 22 Apr 2016 11:45:30 +0900 Namhyung Kim wrote: > > + pid_list->pid_max = READ_ONCE(pid_max); > > + /* Only truncating will shrink pid_max */ > > + if (filtered_pids && filtered_pids->pid_max > pid_list->pid_max) > > + pid_list->pid_max = filtered_pids->pid_max; > > + pid

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-21 Thread Namhyung Kim
Hi Steve, On Tue, Apr 19, 2016 at 10:34:23AM -0400, Steven Rostedt wrote: > From: Steven Rostedt > > In order to add the ability to let tasks that are filtered by the events > have their children also be traced on fork (and then not traced on exit), > convert the array into a pid bitmask. Most o

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
On Tue, 19 Apr 2016 22:59:14 + (UTC) Mathieu Desnoyers wrote: > - On Apr 19, 2016, at 6:49 PM, rostedt rost...@goodmis.org wrote: > > > On Tue, 19 Apr 2016 21:22:21 + (UTC) > > Mathieu Desnoyers wrote: > > > >> It makes sense. Anyway, looking back at my own implementation, I have

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Mathieu Desnoyers
- On Apr 19, 2016, at 6:49 PM, rostedt rost...@goodmis.org wrote: > On Tue, 19 Apr 2016 21:22:21 + (UTC) > Mathieu Desnoyers wrote: > >> It makes sense. Anyway, looking back at my own implementation, I have >> an array of 64 hlist_head entries (64 * 8 = 512 bytes), typically >> populated

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
On Tue, 19 Apr 2016 21:22:21 + (UTC) Mathieu Desnoyers wrote: > It makes sense. Anyway, looking back at my own implementation, I have > an array of 64 hlist_head entries (64 * 8 = 512 bytes), typically > populated by NULL pointers. It's only a factor 8 smaller than the > bitmap, so it's not a

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Mathieu Desnoyers
- On Apr 19, 2016, at 4:50 PM, rostedt rost...@goodmis.org wrote: > On Tue, 19 Apr 2016 20:17:29 + (UTC) > Mathieu Desnoyers wrote: > > >> Ah indeed, since there is a hard limit to 4194304, that makes the >> worse case bitmap 512k. > > Yep. > >> >> We could argue that given a sparse

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
On Tue, 19 Apr 2016 20:17:29 + (UTC) Mathieu Desnoyers wrote: > Ah indeed, since there is a hard limit to 4194304, that makes the > worse case bitmap 512k. Yep. > > We could argue that given a sparse dataset in the PID table (typical > in our use-cases), a small hash table would have bett

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Mathieu Desnoyers
- On Apr 19, 2016, at 3:41 PM, rostedt rost...@goodmis.org wrote: > On Tue, 19 Apr 2016 11:57:32 -0700 > "H. Peter Anvin" wrote: > >> Also, I understand there is one of these bitmaps per ring buffer, and >> the ring buffer is in the tens of megabytes. > > Right, there's only one bitmap per

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
On Tue, 19 Apr 2016 11:57:32 -0700 "H. Peter Anvin" wrote: > Also, I understand there is one of these bitmaps per ring buffer, and > the ring buffer is in the tens of megabytes. Right, there's only one bitmap per tracing instance, which in most cases is just one (I know of people who make more).

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread H. Peter Anvin
On April 19, 2016 10:19:47 AM PDT, Steven Rostedt wrote: >On Tue, 19 Apr 2016 16:55:28 + (UTC) >Mathieu Desnoyers wrote: > >> - On Apr 19, 2016, at 10:34 AM, rostedt rost...@goodmis.org >wrote: >> >> > From: Steven Rostedt >> > >> > In order to add the ability to let tasks that are fil

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
On Tue, 19 Apr 2016 16:55:28 + (UTC) Mathieu Desnoyers wrote: > - On Apr 19, 2016, at 10:34 AM, rostedt rost...@goodmis.org wrote: > > > From: Steven Rostedt > > > > In order to add the ability to let tasks that are filtered by the events > > have their children also be traced on fork

Re: [RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Mathieu Desnoyers
- On Apr 19, 2016, at 10:34 AM, rostedt rost...@goodmis.org wrote: > From: Steven Rostedt > > In order to add the ability to let tasks that are filtered by the events > have their children also be traced on fork (and then not traced on exit), > convert the array into a pid bitmask. Most of

[RFC][PATCH 2/4] tracing: Use pid bitmap instead of a pid array for set_event_pid

2016-04-19 Thread Steven Rostedt
From: Steven Rostedt In order to add the ability to let tasks that are filtered by the events have their children also be traced on fork (and then not traced on exit), convert the array into a pid bitmask. Most of the time the number of pids is only 32768 pids or a 4k bitmask, which is the same s