Re: [tip:perfcounters/core] perf sched: Determine the number of CPUs automatically
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- Subject: Re: [tip:perfcounters/core] perf sched: Determine the number of CPUs automatically
- From: Ingo Molnar <mingo@xxxxxxx>
- Date: Thu, 17 Sep 2009 21:45:30 +0200
- Cc: mingo@xxxxxxxxxx, hpa@xxxxxxxxx, paulus@xxxxxxxxx, acme@xxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, fweisbec@xxxxxxxxx, a.p.zijlstra@xxxxxxxxx, efault@xxxxxx, tglx@xxxxxxxxxxxxx, linux-tip-commits@xxxxxxxxxxxxxxx
- In-reply-to: <20090917213409.39b8509c@xxxxxxxxxxxxx>
- References: <tip-5349256ab12dcbc766495cd1cf3651f7203f8564@xxxxxxxxxxxxxx> <20090917213409.39b8509c@xxxxxxxxxxxxx>
- User-agent: Mutt/1.5.18 (2008-05-17)
* Arjan van de Ven <arjan@xxxxxxxxxxxxx> 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?
Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Stable Commits]
[Linux Stable Kernel]
[Linux Kernel]
[Linux USB Devel]
[Linux Video &Media]
[Linux Audio Users]
[Yosemite News]
[Linux SCSI]