diff options
author | ThiƩbaud Weksteen <tweek@google.com> | 2020-10-23 16:06:59 +0200 |
---|---|---|
committer | ThiƩbaud Weksteen <tweek@google.com> | 2020-10-23 17:47:37 +0200 |
commit | 4848ee07bb07ebb765e6fa0561f0d90ff86bbffb (patch) | |
tree | 04fb66b6c0dedf114f02e200d8c9114f1dfa1df9 /simpleperf/event_type.h | |
parent | cfdf96ecbd3f0814d801469504cf379140c01db3 (diff) | |
download | extras-4848ee07bb07ebb765e6fa0561f0d90ff86bbffb.tar.gz |
simpleperf: enable .clang-format
Use the 2-space configuration by default and disable any formatting for
the demo/ subdirectory. The following command was used to generate this
change:
$ find . \( -name \*.cpp -o -name \*.h \) -exec clang-format \
--style=file -i {} \;
Test: mm
Change-Id: I89ec1f18f6e352f40cfa1a770087f3b586b1d7cb
Diffstat (limited to 'simpleperf/event_type.h')
-rw-r--r-- | simpleperf/event_type.h | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/simpleperf/event_type.h b/simpleperf/event_type.h index 933b1c32..d2cd0c15 100644 --- a/simpleperf/event_type.h +++ b/simpleperf/event_type.h @@ -34,25 +34,22 @@ inline const std::string kETMEventName = "cs-etm"; // the event type is supported by the kernel. struct EventType { - EventType(const std::string& name, uint32_t type, uint64_t config, - const std::string& description, const std::string& limited_arch) - : name(name), type(type), config(config), description(description), - limited_arch(limited_arch) { - } + EventType(const std::string& name, uint32_t type, uint64_t config, const std::string& description, + const std::string& limited_arch) + : name(name), + type(type), + config(config), + description(description), + limited_arch(limited_arch) {} - EventType() : type(0), config(0) { - } + EventType() : type(0), config(0) {} bool operator<(const EventType& other) const { return strcasecmp(name.c_str(), other.name.c_str()) < 0; } - bool IsPmuEvent() const { - return name.find('/') != std::string::npos; - } - bool IsEtmEvent() const { - return name == kETMEventName; - } + bool IsPmuEvent() const { return name.find('/') != std::string::npos; } + bool IsEtmEvent() const { return name == kETMEventName; } std::vector<int> GetPmuCpumask(); @@ -89,8 +86,7 @@ struct EventTypeAndModifier { exclude_hv(false), exclude_host(false), exclude_guest(false), - precise_ip(0) { - } + precise_ip(0) {} }; enum class EventFinderType; @@ -107,7 +103,7 @@ class EventTypeManager { bool WriteTracepointsToFile(const std::string& filepath); // Iterate through all event types, and stop when callback returns false. - bool ForEachType(const std::function<bool (const EventType&)>& callback); + bool ForEachType(const std::function<bool(const EventType&)>& callback); const EventType* FindType(const std::string& name); const EventType* AddRawType(const std::string& name); void RemoveProbeType(const std::string& name); |