lkml.org 
[lkml]   [2009]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:perfcounters/core] perf sched: Determine the number of CPUs automatically

* Ingo Molnar <mingo@elte.hu> wrote:

>
> * Arjan van de Ven <arjan@infradead.org> wrote:
>
> > On Thu, 17 Sep 2009 18:07:09 GMT
> > >
> > > perf sched: Determine the number of CPUs automatically
> > >
> > > For 'perf sched map' output, determine max_cpu automatically,
> > > instead of the static default of 15.
> > >
> > > static u32 curr_pid[MAX_CPUS] = { [0 ... MAX_CPUS-1] = -1 };
> > >
> > > @@ -1818,6 +1818,9 @@ static struct trace_sched_handler map_ops = {
> > >
> > > static void __cmd_map(void)
> > > {
> > > + max_cpu = system("exit `grep ^processor /proc/cpuinfo | wc
> > > -l`");
> >
> > YUCK.
> >
> > what is wrong with
> > max_cpu = sysconf(_SC_NPROCESSORS_CONF);
> > ??
>
> That's nicer - mind sending a patch?

fixed this up myself.

Ingo


\
 
 \ /
  Last update: 2009-09-17 22:13    [W:0.166 / U:0.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site