[<prev] [next>] [day] [month] [year] [list]
Message-ID: <tip-pnbkqo8jxbi49d4f3yd3b5w3@git.kernel.org>
Date: Sat, 26 Jan 2019 01:56:51 -0800
From: tip-bot for Arnaldo Carvalho de Melo <tipbot@...or.com>
To: linux-tip-commits@...r.kernel.org
Cc: mingo@...nel.org, adrian.hunter@...el.com, hpa@...or.com,
acme@...hat.com, linux-kernel@...r.kernel.org, namhyung@...nel.org,
tglx@...utronix.de, jolsa@...nel.org
Subject: [tip:perf/core] perf tools: Move branch structs to branch.h
Commit-ID: f1a397f33743bbb7346cb01e41cc70ca318426e8
Gitweb: https://git.kernel.org/tip/f1a397f33743bbb7346cb01e41cc70ca318426e8
Author: Arnaldo Carvalho de Melo <acme@...hat.com>
AuthorDate: Tue, 22 Jan 2019 10:58:22 -0200
Committer: Arnaldo Carvalho de Melo <acme@...hat.com>
CommitDate: Fri, 25 Jan 2019 15:12:08 +0100
perf tools: Move branch structs to branch.h
We already have it, move those there from events.h so that we untangle
the header dependencies a bit more.
Cc: Adrian Hunter <adrian.hunter@...el.com>
Cc: Jiri Olsa <jolsa@...nel.org>
Cc: Namhyung Kim <namhyung@...nel.org>
Link: https://lkml.kernel.org/n/tip-pnbkqo8jxbi49d4f3yd3b5w3@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@...hat.com>
---
tools/perf/util/branch.h | 27 ++++++++++++++++++++++++---
tools/perf/util/event.h | 21 +--------------------
tools/perf/util/symbol.h | 1 +
3 files changed, 26 insertions(+), 23 deletions(-)
diff --git a/tools/perf/util/branch.h b/tools/perf/util/branch.h
index 1e3c7c5cdc63..64f96b79f1d7 100644
--- a/tools/perf/util/branch.h
+++ b/tools/perf/util/branch.h
@@ -1,8 +1,31 @@
#ifndef _PERF_BRANCH_H
#define _PERF_BRANCH_H 1
+#include <stdio.h>
#include <stdint.h>
-#include "../perf.h"
+#include <linux/perf_event.h>
+#include <linux/types.h>
+
+struct branch_flags {
+ u64 mispred:1;
+ u64 predicted:1;
+ u64 in_tx:1;
+ u64 abort:1;
+ u64 cycles:16;
+ u64 type:4;
+ u64 reserved:40;
+};
+
+struct branch_entry {
+ u64 from;
+ u64 to;
+ struct branch_flags flags;
+};
+
+struct branch_stack {
+ u64 nr;
+ struct branch_entry entries[0];
+};
struct branch_type_stat {
bool branch_to;
@@ -13,8 +36,6 @@ struct branch_type_stat {
u64 cross_2m;
};
-struct branch_flags;
-
void branch_type_count(struct branch_type_stat *st, struct branch_flags *flags,
u64 from, u64 to);
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index dad32b81fe71..feba1aa819b4 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -161,26 +161,7 @@ struct ip_callchain {
u64 ips[0];
};
-struct branch_flags {
- u64 mispred:1;
- u64 predicted:1;
- u64 in_tx:1;
- u64 abort:1;
- u64 cycles:16;
- u64 type:4;
- u64 reserved:40;
-};
-
-struct branch_entry {
- u64 from;
- u64 to;
- struct branch_flags flags;
-};
-
-struct branch_stack {
- u64 nr;
- struct branch_entry entries[0];
-};
+struct branch_stack;
enum {
PERF_IP_FLAG_BRANCH = 1ULL << 0,
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index 277841e3dbd1..956d9916e364 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -12,6 +12,7 @@
#include <stdio.h>
#include <byteswap.h>
#include <libgen.h>
+#include "branch.h"
#include "build-id.h"
#include "event.h"
#include "path.h"
Powered by blists - more mailing lists