gator: Merge gator version 5.23.1
[profile/mobile/platform/kernel/linux-3.10-sc7730.git] / tools / gator / daemon / Config.h
1 /**
2  * Copyright (C) ARM Limited 2010-2015. All rights reserved.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  */
8
9 #ifndef CONFIG_H
10 #define CONFIG_H
11
12 #define STRIFY2(ARG) #ARG
13 #define STRIFY(ARG) STRIFY2(ARG)
14
15 #define ARRAY_LENGTH(A) static_cast<int>(sizeof(A)/sizeof((A)[0]))
16 #define ACCESS_ONCE(x) (*(volatile typeof(x)*)&(x))
17
18 #define MAX_PERFORMANCE_COUNTERS 50
19 #define NR_CPUS 32
20
21 // If debugfs is not mounted at /sys/kernel/debug, update TRACING_PATH
22 #define TRACING_PATH "/sys/kernel/debug/tracing"
23 #define EVENTS_PATH TRACING_PATH "/events"
24
25 template<typename T>
26 static inline T min(const T a, const T b) {
27         return (a < b ? a : b);
28 }
29
30 template<typename T>
31 static inline T max(const T a, const T b) {
32         return (a > b ? a : b);
33 }
34
35 #endif // CONFIG_H