3 * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
5 * This program is free software and is provided to you under the terms of the
6 * GNU General Public License version 2 as published by the Free Software
7 * Foundation, and any use by you of this program is subject to the terms
10 * A copy of the licence is included with the program, and can also be obtained
11 * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12 * Boston, MA 02110-1301, USA.
18 #ifndef _KBASE_HWCNT_READER_H_
19 #define _KBASE_HWCNT_READER_H_
21 /* The ids of ioctl commands. */
22 #define KBASE_HWCNT_READER 0xBE
23 #define KBASE_HWCNT_READER_GET_HWVER _IOR(KBASE_HWCNT_READER, 0x00, u32)
24 #define KBASE_HWCNT_READER_GET_BUFFER_SIZE _IOR(KBASE_HWCNT_READER, 0x01, u32)
25 #define KBASE_HWCNT_READER_DUMP _IOW(KBASE_HWCNT_READER, 0x10, u32)
26 #define KBASE_HWCNT_READER_CLEAR _IOW(KBASE_HWCNT_READER, 0x11, u32)
27 #define KBASE_HWCNT_READER_GET_BUFFER _IOR(KBASE_HWCNT_READER, 0x20,\
28 struct kbase_hwcnt_reader_metadata)
29 #define KBASE_HWCNT_READER_PUT_BUFFER _IOW(KBASE_HWCNT_READER, 0x21,\
30 struct kbase_hwcnt_reader_metadata)
31 #define KBASE_HWCNT_READER_SET_INTERVAL _IOW(KBASE_HWCNT_READER, 0x30, u32)
32 #define KBASE_HWCNT_READER_ENABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x40, u32)
33 #define KBASE_HWCNT_READER_DISABLE_EVENT _IOW(KBASE_HWCNT_READER, 0x41, u32)
34 #define KBASE_HWCNT_READER_GET_API_VERSION _IOW(KBASE_HWCNT_READER, 0xFF, u32)
37 * struct kbase_hwcnt_reader_metadata - hwcnt reader sample buffer metadata
38 * @timestamp: time when sample was collected
39 * @event_id: id of an event that triggered sample collection
40 * @buffer_idx: position in sampling area where sample buffer was stored
42 struct kbase_hwcnt_reader_metadata
{
49 * enum base_hwcnt_reader_event - hwcnt dumping events
50 * @BASE_HWCNT_READER_EVENT_MANUAL: manual request for dump
51 * @BASE_HWCNT_READER_EVENT_PERIODIC: periodic dump
52 * @BASE_HWCNT_READER_EVENT_PREJOB: prejob dump request
53 * @BASE_HWCNT_READER_EVENT_POSTJOB: postjob dump request
54 * @BASE_HWCNT_READER_EVENT_COUNT: number of supported events
56 enum base_hwcnt_reader_event
{
57 BASE_HWCNT_READER_EVENT_MANUAL
,
58 BASE_HWCNT_READER_EVENT_PERIODIC
,
59 BASE_HWCNT_READER_EVENT_PREJOB
,
60 BASE_HWCNT_READER_EVENT_POSTJOB
,
62 BASE_HWCNT_READER_EVENT_COUNT
65 #endif /* _KBASE_HWCNT_READER_H_ */