Re: [PATCH v4 1/2] trace-cmd: Optimize how pid filters are expressed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 17, 2019 at 04:18:50PM +0200 John Kacur wrote:
> 
> 
> On Wed, 17 Apr 2019, Phil Auld wrote:
> 
> > On Wed, Apr 17, 2019 at 04:09:58PM +0300 Slavomir Kaslev wrote:
> > > Express pid filters as allowed/disallowed filter ranges
> > > 
> > >   (pid>=100&&pid<=103)
> > > 
> > > instead of specifying them per pid
> > > 
> > >   (pid==100||pid==101||pid==102||pid==103)
> > > 
> > > This makes the size of the resulting filter smaller (and faster) and avoids
> > > overflowing the filter size limit of one page which we can hit on bigger
> > > machines (say >160 CPUs).
> > 
> > This one works as well :)
> > 
> > I finally hit a case where my trace-cmd pids were non-contiguous and 
> > this split the range up correctly. 
> > 
> > 
> > FILTER write /sys/kernel/debug/tracing/events/sched/sched_kthread_stop/filter (len 74) value "(common_pid<21420||common_pid>21425)&&(common_pid<21265||common_pid>21418)"
> > FILTER write /sys/kernel/debug/tracing/events/sched/sched_kthread_stop_ret/filter (len 74) value "(common_pid<21420||common_pid>21425)&&(common_pid<21265||common_pid>21418)"
> > ...
> > FILTER write /sys/kernel/debug/tracing/events/sched/sched_switch/filter (len 142) value "(common_pid<21420||common_pid>21425)&&(common_pid<21265||common_pid>21418)||(next_pid<21420||next_pid>21425)&&(next_pid<21265||next_pid>21418)"
> 
> It seems crazy that we write "common_pid", instead of "pid" or "cpid", or 
> something like that.
> 
> 
> 

I assume those have to match fields in the trace event mechanism, but I don't know a lot 
about it. 

"pid" is used in the wakeup event filters:

FILTER write /sys/kernel/debug/tracing/events/sched/sched_wakeup_new/filter (len 122) value "(common_pid<21420||common_pid>21425)&&(common_pid<21265||common_pid>21418)||(pid<21420||pid>21425)&&(pid<21265||pid>21418)"




Cheers,
Phil



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux