2 * Copyright (C) ARM Limited 2013-2014. All rights reserved.
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.
14 // If debugfs is not mounted at /sys/kernel/debug, update DEBUGFS_PATH
15 #define DEBUGFS_PATH "/sys/kernel/debug"
16 #define EVENTS_PATH DEBUGFS_PATH "/tracing/events"
18 #define SCHED_SWITCH "sched/sched_switch"
25 class PerfDriver : public Driver {
30 bool getLegacySupport() const { return mLegacySupport; }
33 bool summary(Buffer *const buffer);
34 bool isSetup() const { return mIsSetup; }
36 bool claimCounter(const Counter &counter) const;
38 void setupCounter(Counter &counter);
40 int writeCounters(mxml_node_t *root) const;
42 bool enable(PerfGroup *const group, Buffer *const buffer) const;
44 static long long getTracepointId(const char *const name, DynBuf *const printb);
47 PerfCounter *findCounter(const Counter &counter) const;
48 void addCpuCounters(const char *const counterName, const int type, const int numCounters);
49 void addUncoreCounters(const char *const counterName, const int type, const int numCounters);
51 PerfCounter *mCounters;
55 // Intentionally undefined
56 PerfDriver(const PerfDriver &);
57 PerfDriver &operator=(const PerfDriver &);
60 #endif // PERFDRIVER_H