This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Help configuring PMU's

Hi,

I'm trying to enable PMU's on arm versatile juno r2 development board.

I've already read this manuals from arm:
ARM ® Cortex ® -A72 MPCore Processor
ARM® Cortex ® -A53 MPCore Processor
Juno r2 ARM® Development Platform SoC
ARM® Architecture Reference Manual ARMv8, for ARMv8-A architecture profile

Searching online I found this guides:
http://zhiyisun.github.io/2016/03/02/How-to-Use-Performance-Monitor-Unit-(PMU)-of-64-bit-ARMv8-A-in-Linux.html
http://valtrix.in/programming/programming-armv8-performance-counters
http://syndication2605.rssing.com/chan-30054360/latest.php#item4
https://github.com/thoughtpolice/enable_arm_pmu/blob/master/ko/enable_arm_pmu.c
http://ilinuxkernel.com/?p=1755

The code i'm trying to compile (from the github link) on my host machine is:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
* Enable user-mode ARM performance counter access.
*/
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/smp.h>
/** -- Configuration stuff ------------------------------------------------- */
#define DRVR_NAME "enable_arm_pmu"
#if !defined(__arm__)
#error Module can only be compiled on ARM machines.
#endif
/** -- Initialization & boilerplate ---------------------------------------- */
#define PERF_DEF_OPTS (1 | 16)
#define PERF_OPT_RESET_CYCLES (2 | 4)
#define PERF_OPT_DIV64 (8)
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I have a Makefile:
Fullscreen
1
2
3
4
5
6
7
8
PWD := $(shell pwd)
obj-m += enable_arm_pmu.o
all:
make ARCH=arm CROSS_COMPILE=$(CROSS) -C $(KERNEL) SUBDIRS=$(PWD) modules
clean:
make -C $(KERNEL) SUBDIRS=$(PWD) clean
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I'm compiling with:
Fullscreen
1
make KERNEL=/lib/modules/4.13.0-45-generic/build CROSS=aarch64-linux-gnu-
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


I'm getting this output logs:
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- -C /lib/modules/4.13.0-45-generic/build SUBDIRS=/home/lfpm1993/Desktop modules
make[1]: Entering directory '/usr/src/linux-headers-4.13.0-45-generic'
CC [M] /home/lfpm1993/Desktop/teste.o
aarch64-linux-gnu-gcc: error: unrecognized argument in option ‘-mabi=apcs-gnu’
aarch64-linux-gnu-gcc: note: valid arguments to ‘-mabi=’ are: ilp32 lp64
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mapcs’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mno-sched-prolog’
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-msoft-float’
scripts/Makefile.build:323: recipe for target '/home/lfpm1993/Desktop/teste.o' failed
make[2]: *** [/home/lfpm1993/Desktop/teste.o] Error 1
Makefile:1550: recipe for target '_module_/home/lfpm1993/Desktop' failed
make[1]: *** [_module_/home/lfpm1993/Desktop] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.13.0-45-generic'
Makefile:6: recipe for target 'all' failed
make: *** [all] Error 2
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


Any ideas what I've done wrong?

Thanks,
Luís

0