[fedora-arm] Linux kernel arm oprofile driver compilation problem

William Cohen wcohen at redhat.com
Thu Feb 23 04:08:23 UTC 2012


I was looking to see why the arm kernel builds for fedora 17 were failing with:

arch/arm/oprofile/../../../drivers/oprofile/oprofile_perf.c:28:28: error: variably modified 'perf_events' at file scope

The error points to the following line in oprofile_perf.c:
 
static struct perf_event **perf_events[nr_cpumask_bits];

The nr_cpumask_bits is defined in linux/include/linux/cpumask.h with
the following snippet of code:

#if NR_CPUS == 1
#define nr_cpu_ids              1
#else
extern int nr_cpu_ids;
#endif

#ifdef CONFIG_CPUMASK_OFFSTACK
/* Assuming NR_CPUS is huge, a runtime limit is more efficient.  Also,
 * not all bits may be allocated. */
#define nr_cpumask_bits nr_cpu_ids
#else
#define nr_cpumask_bits NR_CPUS
#endif

The problem is that several arm machines have more than one processor
(CONFIG_NR_CPUS>1), making nr_cpumask_bits be a variable rather than a
compile time constant.  Seems like the kernel should dynamically allocate
space for perf_events[nr_cpumask_bits] because of the variable nature
of nr_cpu_mask_bits.


An example of a problem arm kernel build can be found at:

http://arm.koji.fedoraproject.org/koji/buildinfo?buildID=56273

The log file with the error message can be found at:

http://arm.koji.fedoraproject.org/koji/getfile?taskID=458300&name=build.log

-Will


More information about the arm mailing list