blob: 8b91297d856b99713769aa2a3b78c547a490ff10 (plain
Before compiling the program, you must change the items below accroding to your environment:
- 'CROSS_COMPILE' in Makefile
- STM device name in stm_user_api.h
- TMC device name in stm_user_api.h
If you don't care what channel(s) will the trace data be written on, you don't need to read the following words.
But if not, there will be two ways for you you to create and set a policy for the application program:
1) Set a policy in the program via ioctl() system call like  is doing, in this way you can use more than one channel,
since the channel number you want to use can be set by ioctl().
2) Simply use the first available channel selected from a policy named "default" which has to be created via sysfs:
Mount configfs manually with:
/ # mount -t configfs none /config
Create policy directory for STM device:
/ # mkdir /config/stp-policy/20100000.stm.abc
The directory name consists of the STM device name to which the policy applies and the policy name separated by a dot.
The device name (say 20100000.stm) have to be matched the name of STM device which can be found under /dev.
The suffix is a arbitrary string without dot.
/ # mkdir /config/stp-policy/20100000.stm.abc/default
The range of channels and masters of default policy can be changed according to your requirement.
 https://git.linaro.org/people/zhang.chunyan/sample-app.git branch stm-mmap-sample