* [PATCH 01/10] perf tools: Remove MAX_COUNTERS define from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:47 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 02/10] perf tools: Remove unlikely " Jiri Olsa
` (10 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
As it's no longer used.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 5aa8ac4..3bea2e6 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -231,7 +231,6 @@ sys_perf_event_open(struct perf_event_attr *attr,
return fd;
}
-#define MAX_COUNTERS 256
#define MAX_NR_CPUS 256
struct ip_callchain {
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Remove MAX_COUNTERS define from perf.h
2014-05-05 12:33 ` [PATCH 01/10] perf tools: Remove MAX_COUNTERS define from perf.h Jiri Olsa
@ 2014-05-05 17:47 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:47 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 3dd422b4a5009e7654846534d535758d4cc985db
Gitweb: http://git.kernel.org/tip/3dd422b4a5009e7654846534d535758d4cc985db
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:26:14 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:45:20 +0200
perf tools: Remove MAX_COUNTERS define from perf.h
As it's no longer used.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-2-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 5aa8ac4..3bea2e6 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -231,7 +231,6 @@ sys_perf_event_open(struct perf_event_attr *attr,
return fd;
}
-#define MAX_COUNTERS 256
#define MAX_NR_CPUS 256
struct ip_callchain {
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 02/10] perf tools: Remove unlikely define from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
2014-05-05 12:33 ` [PATCH 01/10] perf tools: Remove MAX_COUNTERS define from perf.h Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:48 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 03/10] perf tools: Remove min " Jiri Olsa
` (9 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
It's defined in tools/include/linux/compiler.h header.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 3bea2e6..a547f38 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -203,7 +203,6 @@ static inline unsigned long long rdclock(void)
*/
#define asmlinkage
-#define unlikely(x) __builtin_expect(!!(x), 0)
#define min(x, y) ({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Remove unlikely define from perf.h
2014-05-05 12:33 ` [PATCH 02/10] perf tools: Remove unlikely " Jiri Olsa
@ 2014-05-05 17:48 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 8be26c539f0d4c77a798b20515ad6404d72de74d
Gitweb: http://git.kernel.org/tip/8be26c539f0d4c77a798b20515ad6404d72de74d
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:32:05 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:46:10 +0200
perf tools: Remove unlikely define from perf.h
It's defined in tools/include/linux/compiler.h header.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-3-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 3bea2e6..a547f38 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -203,7 +203,6 @@ static inline unsigned long long rdclock(void)
*/
#define asmlinkage
-#define unlikely(x) __builtin_expect(!!(x), 0)
#define min(x, y) ({ \
typeof(x) _min1 = (x); \
typeof(y) _min2 = (y); \
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 03/10] perf tools: Remove min define from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
2014-05-05 12:33 ` [PATCH 01/10] perf tools: Remove MAX_COUNTERS define from perf.h Jiri Olsa
2014-05-05 12:33 ` [PATCH 02/10] perf tools: Remove unlikely " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:48 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 04/10] perf tools: Remove asmlinkage " Jiri Olsa
` (8 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
It's defined in tools/perf/util/include/linux/kernel.h header.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index a547f38..50aa88d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -203,12 +203,6 @@ static inline unsigned long long rdclock(void)
*/
#define asmlinkage
-#define min(x, y) ({ \
- typeof(x) _min1 = (x); \
- typeof(y) _min2 = (y); \
- (void) (&_min1 == &_min2); \
- _min1 < _min2 ? _min1 : _min2; })
-
extern bool test_attr__enabled;
void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Remove min define from perf.h
2014-05-05 12:33 ` [PATCH 03/10] perf tools: Remove min " Jiri Olsa
@ 2014-05-05 17:48 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 1b7ae1c941af21ec386ea7c7e812ba430652731c
Gitweb: http://git.kernel.org/tip/1b7ae1c941af21ec386ea7c7e812ba430652731c
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:34:12 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:46:41 +0200
perf tools: Remove min define from perf.h
It's defined in tools/perf/util/include/linux/kernel.h header.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-4-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index a547f38..50aa88d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -203,12 +203,6 @@ static inline unsigned long long rdclock(void)
*/
#define asmlinkage
-#define min(x, y) ({ \
- typeof(x) _min1 = (x); \
- typeof(y) _min2 = (y); \
- (void) (&_min1 == &_min2); \
- _min1 < _min2 ? _min1 : _min2; })
-
extern bool test_attr__enabled;
void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 04/10] perf tools: Remove asmlinkage define from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (2 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 03/10] perf tools: Remove min " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:48 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 05/10] perf tools: Remove PR_TASK_PERF_EVENTS_* " Jiri Olsa
` (7 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
As it's no longer used.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 50aa88d..622949d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -198,11 +198,6 @@ static inline unsigned long long rdclock(void)
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
-/*
- * Pick up some kernel type conventions:
- */
-#define asmlinkage
-
extern bool test_attr__enabled;
void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Remove asmlinkage define from perf.h
2014-05-05 12:33 ` [PATCH 04/10] perf tools: Remove asmlinkage " Jiri Olsa
@ 2014-05-05 17:48 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 273a0a734cd780f9ab3c3aac1851b2d15bb9638d
Gitweb: http://git.kernel.org/tip/273a0a734cd780f9ab3c3aac1851b2d15bb9638d
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:36:38 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:47:06 +0200
perf tools: Remove asmlinkage define from perf.h
As it's no longer used.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-5-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 5 -----
1 file changed, 5 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 50aa88d..622949d 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -198,11 +198,6 @@ static inline unsigned long long rdclock(void)
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
-/*
- * Pick up some kernel type conventions:
- */
-#define asmlinkage
-
extern bool test_attr__enabled;
void test_attr__init(void);
void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 05/10] perf tools: Remove PR_TASK_PERF_EVENTS_* from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (3 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 04/10] perf tools: Remove asmlinkage " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:48 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 06/10] perf tools: Move sample data structures " Jiri Olsa
` (6 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
It's defined in include/uapi/linux/prctl.h header.
Also it was never used in perf tool.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 622949d..1bf9537 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -176,13 +176,6 @@
#include <linux/types.h>
#include <linux/perf_event.h>
-/*
- * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
- * counters in the current task.
- */
-#define PR_TASK_PERF_EVENTS_DISABLE 31
-#define PR_TASK_PERF_EVENTS_ENABLE 32
-
#ifndef NSEC_PER_SEC
# define NSEC_PER_SEC 1000000000ULL
#endif
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Remove PR_TASK_PERF_EVENTS_* from perf.h
2014-05-05 12:33 ` [PATCH 05/10] perf tools: Remove PR_TASK_PERF_EVENTS_* " Jiri Olsa
@ 2014-05-05 17:48 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 36446f4bfe613ad1da00f06081d410d62c07d334
Gitweb: http://git.kernel.org/tip/36446f4bfe613ad1da00f06081d410d62c07d334
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:37:05 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:47:25 +0200
perf tools: Remove PR_TASK_PERF_EVENTS_* from perf.h
It's defined in include/uapi/linux/prctl.h header.
Also it was never used in perf tool.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-6-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 7 -------
1 file changed, 7 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 622949d..1bf9537 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -176,13 +176,6 @@
#include <linux/types.h>
#include <linux/perf_event.h>
-/*
- * prctl(PR_TASK_PERF_EVENTS_DISABLE) will (cheaply) disable all
- * counters in the current task.
- */
-#define PR_TASK_PERF_EVENTS_DISABLE 31
-#define PR_TASK_PERF_EVENTS_ENABLE 32
-
#ifndef NSEC_PER_SEC
# define NSEC_PER_SEC 1000000000ULL
#endif
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 06/10] perf tools: Move sample data structures from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (4 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 05/10] perf tools: Remove PR_TASK_PERF_EVENTS_* " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:48 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 07/10] perf tools: Move perf_call_graph_mode enum " Jiri Olsa
` (5 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
Into util/event.h header where all sample data structures
are defined.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 24 ------------------------
tools/perf/util/event.h | 24 ++++++++++++++++++++++++
tools/perf/util/symbol.h | 1 +
3 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 1bf9537..cf8f228 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -214,30 +214,6 @@ sys_perf_event_open(struct perf_event_attr *attr,
#define MAX_NR_CPUS 256
-struct ip_callchain {
- u64 nr;
- u64 ips[0];
-};
-
-struct branch_flags {
- u64 mispred:1;
- u64 predicted:1;
- u64 in_tx:1;
- u64 abort:1;
- u64 reserved:60;
-};
-
-struct branch_entry {
- u64 from;
- u64 to;
- struct branch_flags flags;
-};
-
-struct branch_stack {
- u64 nr;
- struct branch_entry entries[0];
-};
-
extern const char *input_name;
extern bool perf_host, perf_guest;
extern const char perf_version_string[];
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 38457d4..d970232 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -112,6 +112,30 @@ struct sample_read {
};
};
+struct ip_callchain {
+ u64 nr;
+ u64 ips[0];
+};
+
+struct branch_flags {
+ u64 mispred:1;
+ u64 predicted:1;
+ u64 in_tx:1;
+ u64 abort:1;
+ u64 reserved:60;
+};
+
+struct branch_entry {
+ u64 from;
+ u64 to;
+ struct branch_flags flags;
+};
+
+struct branch_stack {
+ u64 nr;
+ struct branch_entry entries[0];
+};
+
struct perf_sample {
u64 ip;
u32 pid, tid;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ae94e00..33ede53 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -12,6 +12,7 @@
#include <byteswap.h>
#include <libgen.h>
#include "build-id.h"
+#include "event.h"
#ifdef HAVE_LIBELF_SUPPORT
#include <libelf.h>
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Move sample data structures from perf.h
2014-05-05 12:33 ` [PATCH 06/10] perf tools: Move sample data structures " Jiri Olsa
@ 2014-05-05 17:48 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:48 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 0776eb59354f8b848e5738a612c272d8f48de9bf
Gitweb: http://git.kernel.org/tip/0776eb59354f8b848e5738a612c272d8f48de9bf
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:41:45 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:47:40 +0200
perf tools: Move sample data structures from perf.h
Into util/event.h header where all sample data structures
are defined.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-7-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 24 ------------------------
tools/perf/util/event.h | 24 ++++++++++++++++++++++++
tools/perf/util/symbol.h | 1 +
3 files changed, 25 insertions(+), 24 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 1bf9537..cf8f228 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -214,30 +214,6 @@ sys_perf_event_open(struct perf_event_attr *attr,
#define MAX_NR_CPUS 256
-struct ip_callchain {
- u64 nr;
- u64 ips[0];
-};
-
-struct branch_flags {
- u64 mispred:1;
- u64 predicted:1;
- u64 in_tx:1;
- u64 abort:1;
- u64 reserved:60;
-};
-
-struct branch_entry {
- u64 from;
- u64 to;
- struct branch_flags flags;
-};
-
-struct branch_stack {
- u64 nr;
- struct branch_entry entries[0];
-};
-
extern const char *input_name;
extern bool perf_host, perf_guest;
extern const char perf_version_string[];
diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h
index 38457d4..d970232 100644
--- a/tools/perf/util/event.h
+++ b/tools/perf/util/event.h
@@ -112,6 +112,30 @@ struct sample_read {
};
};
+struct ip_callchain {
+ u64 nr;
+ u64 ips[0];
+};
+
+struct branch_flags {
+ u64 mispred:1;
+ u64 predicted:1;
+ u64 in_tx:1;
+ u64 abort:1;
+ u64 reserved:60;
+};
+
+struct branch_entry {
+ u64 from;
+ u64 to;
+ struct branch_flags flags;
+};
+
+struct branch_stack {
+ u64 nr;
+ struct branch_entry entries[0];
+};
+
struct perf_sample {
u64 ip;
u32 pid, tid;
diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
index ae94e00..33ede53 100644
--- a/tools/perf/util/symbol.h
+++ b/tools/perf/util/symbol.h
@@ -12,6 +12,7 @@
#include <byteswap.h>
#include <libgen.h>
#include "build-id.h"
+#include "event.h"
#ifdef HAVE_LIBELF_SUPPORT
#include <libelf.h>
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 07/10] perf tools: Move perf_call_graph_mode enum from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (5 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 06/10] perf tools: Move sample data structures " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:49 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 08/10] perf tools: Move syscall and arch specific defines " Jiri Olsa
` (4 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
Into util/callchain.h header where all callchain related
structures should be.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 7 -------
tools/perf/util/callchain.h | 7 +++++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index cf8f228..d51a994 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -222,13 +222,6 @@ void pthread__unblock_sigwinch(void);
#include "util/target.h"
-enum perf_call_graph_mode {
- CALLCHAIN_NONE,
- CALLCHAIN_FP,
- CALLCHAIN_DWARF,
- CALLCHAIN_MAX
-};
-
struct record_opts {
struct target target;
int call_graph;
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index dda4cf8..bde2b0c 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -7,6 +7,13 @@
#include "event.h"
#include "symbol.h"
+enum perf_call_graph_mode {
+ CALLCHAIN_NONE,
+ CALLCHAIN_FP,
+ CALLCHAIN_DWARF,
+ CALLCHAIN_MAX
+};
+
enum chain_mode {
CHAIN_NONE,
CHAIN_FLAT,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Move perf_call_graph_mode enum from perf.h
2014-05-05 12:33 ` [PATCH 07/10] perf tools: Move perf_call_graph_mode enum " Jiri Olsa
@ 2014-05-05 17:49 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:49 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 2c83bc08e305e135b954d82596864b7d024fc7fd
Gitweb: http://git.kernel.org/tip/2c83bc08e305e135b954d82596864b7d024fc7fd
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:46:17 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:48:10 +0200
perf tools: Move perf_call_graph_mode enum from perf.h
Into util/callchain.h header where all callchain related
structures should be.
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-8-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 7 -------
tools/perf/util/callchain.h | 7 +++++++
2 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index cf8f228..d51a994 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -222,13 +222,6 @@ void pthread__unblock_sigwinch(void);
#include "util/target.h"
-enum perf_call_graph_mode {
- CALLCHAIN_NONE,
- CALLCHAIN_FP,
- CALLCHAIN_DWARF,
- CALLCHAIN_MAX
-};
-
struct record_opts {
struct target target;
int call_graph;
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index dda4cf8..bde2b0c 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -7,6 +7,13 @@
#include "event.h"
#include "symbol.h"
+enum perf_call_graph_mode {
+ CALLCHAIN_NONE,
+ CALLCHAIN_FP,
+ CALLCHAIN_DWARF,
+ CALLCHAIN_MAX
+};
+
enum chain_mode {
CHAIN_NONE,
CHAIN_FLAT,
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 08/10] perf tools: Move syscall and arch specific defines from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (6 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 07/10] perf tools: Move perf_call_graph_mode enum " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:49 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 09/10] perf tools: Move sys_perf_event_open function " Jiri Olsa
` (3 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
Into new perf-sys.h header.
The main reason is to separate system specific perf data
from perf tool stuff, so it could be used in small test
programs, as requested Peter:
http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
This separation makes the perf.h header more clear.
Requested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf-sys.h | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++
tools/perf/perf.h | 165 +------------------------------------------------
2 files changed, 169 insertions(+), 164 deletions(-)
create mode 100644 tools/perf/perf-sys.h
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
new file mode 100644
index 0000000..4c22c2a
--- /dev/null
+++ b/tools/perf/perf-sys.h
@@ -0,0 +1,168 @@
+#ifndef _PERF_SYS_H
+#define _PERF_SYS_H
+
+#include <asm/unistd.h>
+
+#if defined(__i386__)
+#define mb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
+#define wmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
+#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
+#define cpu_relax() asm volatile("rep; nop" ::: "memory");
+#define CPUINFO_PROC "model name"
+#ifndef __NR_perf_event_open
+# define __NR_perf_event_open 336
+#endif
+#ifndef __NR_futex
+# define __NR_futex 240
+#endif
+#ifndef __NR_gettid
+# define __NR_gettid 224
+#endif
+#endif
+
+#if defined(__x86_64__)
+#define mb() asm volatile("mfence" ::: "memory")
+#define wmb() asm volatile("sfence" ::: "memory")
+#define rmb() asm volatile("lfence" ::: "memory")
+#define cpu_relax() asm volatile("rep; nop" ::: "memory");
+#define CPUINFO_PROC "model name"
+#ifndef __NR_perf_event_open
+# define __NR_perf_event_open 298
+#endif
+#ifndef __NR_futex
+# define __NR_futex 202
+#endif
+#ifndef __NR_gettid
+# define __NR_gettid 186
+#endif
+#endif
+
+#ifdef __powerpc__
+#include "../../arch/powerpc/include/uapi/asm/unistd.h"
+#define mb() asm volatile ("sync" ::: "memory")
+#define wmb() asm volatile ("sync" ::: "memory")
+#define rmb() asm volatile ("sync" ::: "memory")
+#define CPUINFO_PROC "cpu"
+#endif
+
+#ifdef __s390__
+#define mb() asm volatile("bcr 15,0" ::: "memory")
+#define wmb() asm volatile("bcr 15,0" ::: "memory")
+#define rmb() asm volatile("bcr 15,0" ::: "memory")
+#endif
+
+#ifdef __sh__
+#if defined(__SH4A__) || defined(__SH5__)
+# define mb() asm volatile("synco" ::: "memory")
+# define wmb() asm volatile("synco" ::: "memory")
+# define rmb() asm volatile("synco" ::: "memory")
+#else
+# define mb() asm volatile("" ::: "memory")
+# define wmb() asm volatile("" ::: "memory")
+# define rmb() asm volatile("" ::: "memory")
+#endif
+#define CPUINFO_PROC "cpu type"
+#endif
+
+#ifdef __hppa__
+#define mb() asm volatile("" ::: "memory")
+#define wmb() asm volatile("" ::: "memory")
+#define rmb() asm volatile("" ::: "memory")
+#define CPUINFO_PROC "cpu"
+#endif
+
+#ifdef __sparc__
+#ifdef __LP64__
+#define mb() asm volatile("ba,pt %%xcc, 1f\n" \
+ "membar #StoreLoad\n" \
+ "1:\n":::"memory")
+#else
+#define mb() asm volatile("":::"memory")
+#endif
+#define wmb() asm volatile("":::"memory")
+#define rmb() asm volatile("":::"memory")
+#define CPUINFO_PROC "cpu"
+#endif
+
+#ifdef __alpha__
+#define mb() asm volatile("mb" ::: "memory")
+#define wmb() asm volatile("wmb" ::: "memory")
+#define rmb() asm volatile("mb" ::: "memory")
+#define CPUINFO_PROC "cpu model"
+#endif
+
+#ifdef __ia64__
+#define mb() asm volatile ("mf" ::: "memory")
+#define wmb() asm volatile ("mf" ::: "memory")
+#define rmb() asm volatile ("mf" ::: "memory")
+#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
+#define CPUINFO_PROC "model name"
+#endif
+
+#ifdef __arm__
+/*
+ * Use the __kuser_memory_barrier helper in the CPU helper page. See
+ * arch/arm/kernel/entry-armv.S in the kernel source for details.
+ */
+#define mb() ((void(*)(void))0xffff0fa0)()
+#define wmb() ((void(*)(void))0xffff0fa0)()
+#define rmb() ((void(*)(void))0xffff0fa0)()
+#define CPUINFO_PROC "Processor"
+#endif
+
+#ifdef __aarch64__
+#define mb() asm volatile("dmb ish" ::: "memory")
+#define wmb() asm volatile("dmb ishst" ::: "memory")
+#define rmb() asm volatile("dmb ishld" ::: "memory")
+#define cpu_relax() asm volatile("yield" ::: "memory")
+#endif
+
+#ifdef __mips__
+#define mb() asm volatile( \
+ ".set mips2\n\t" \
+ "sync\n\t" \
+ ".set mips0" \
+ : /* no output */ \
+ : /* no input */ \
+ : "memory")
+#define wmb() mb()
+#define rmb() mb()
+#define CPUINFO_PROC "cpu model"
+#endif
+
+#ifdef __arc__
+#define mb() asm volatile("" ::: "memory")
+#define wmb() asm volatile("" ::: "memory")
+#define rmb() asm volatile("" ::: "memory")
+#define CPUINFO_PROC "Processor"
+#endif
+
+#ifdef __metag__
+#define mb() asm volatile("" ::: "memory")
+#define wmb() asm volatile("" ::: "memory")
+#define rmb() asm volatile("" ::: "memory")
+#define CPUINFO_PROC "CPU"
+#endif
+
+#ifdef __xtensa__
+#define mb() asm volatile("memw" ::: "memory")
+#define wmb() asm volatile("memw" ::: "memory")
+#define rmb() asm volatile("" ::: "memory")
+#define CPUINFO_PROC "core ID"
+#endif
+
+#ifdef __tile__
+#define mb() asm volatile ("mf" ::: "memory")
+#define wmb() asm volatile ("mf" ::: "memory")
+#define rmb() asm volatile ("mf" ::: "memory")
+#define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
+#define CPUINFO_PROC "model name"
+#endif
+
+#define barrier() asm volatile ("" ::: "memory")
+
+#ifndef cpu_relax
+#define cpu_relax() barrier()
+#endif
+
+#endif /* _PERF_SYS_H */
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index d51a994..ee95965 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,173 +1,10 @@
#ifndef _PERF_PERF_H
#define _PERF_PERF_H
-#include <asm/unistd.h>
-
-#if defined(__i386__)
-#define mb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define wmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define cpu_relax() asm volatile("rep; nop" ::: "memory");
-#define CPUINFO_PROC "model name"
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 336
-#endif
-#ifndef __NR_futex
-# define __NR_futex 240
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 224
-#endif
-#endif
-
-#if defined(__x86_64__)
-#define mb() asm volatile("mfence" ::: "memory")
-#define wmb() asm volatile("sfence" ::: "memory")
-#define rmb() asm volatile("lfence" ::: "memory")
-#define cpu_relax() asm volatile("rep; nop" ::: "memory");
-#define CPUINFO_PROC "model name"
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 298
-#endif
-#ifndef __NR_futex
-# define __NR_futex 202
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 186
-#endif
-#endif
-
-#ifdef __powerpc__
-#include "../../arch/powerpc/include/uapi/asm/unistd.h"
-#define mb() asm volatile ("sync" ::: "memory")
-#define wmb() asm volatile ("sync" ::: "memory")
-#define rmb() asm volatile ("sync" ::: "memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __s390__
-#define mb() asm volatile("bcr 15,0" ::: "memory")
-#define wmb() asm volatile("bcr 15,0" ::: "memory")
-#define rmb() asm volatile("bcr 15,0" ::: "memory")
-#endif
-
-#ifdef __sh__
-#if defined(__SH4A__) || defined(__SH5__)
-# define mb() asm volatile("synco" ::: "memory")
-# define wmb() asm volatile("synco" ::: "memory")
-# define rmb() asm volatile("synco" ::: "memory")
-#else
-# define mb() asm volatile("" ::: "memory")
-# define wmb() asm volatile("" ::: "memory")
-# define rmb() asm volatile("" ::: "memory")
-#endif
-#define CPUINFO_PROC "cpu type"
-#endif
-
-#ifdef __hppa__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __sparc__
-#ifdef __LP64__
-#define mb() asm volatile("ba,pt %%xcc, 1f\n" \
- "membar #StoreLoad\n" \
- "1:\n":::"memory")
-#else
-#define mb() asm volatile("":::"memory")
-#endif
-#define wmb() asm volatile("":::"memory")
-#define rmb() asm volatile("":::"memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __alpha__
-#define mb() asm volatile("mb" ::: "memory")
-#define wmb() asm volatile("wmb" ::: "memory")
-#define rmb() asm volatile("mb" ::: "memory")
-#define CPUINFO_PROC "cpu model"
-#endif
-
-#ifdef __ia64__
-#define mb() asm volatile ("mf" ::: "memory")
-#define wmb() asm volatile ("mf" ::: "memory")
-#define rmb() asm volatile ("mf" ::: "memory")
-#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
-#define CPUINFO_PROC "model name"
-#endif
-
-#ifdef __arm__
-/*
- * Use the __kuser_memory_barrier helper in the CPU helper page. See
- * arch/arm/kernel/entry-armv.S in the kernel source for details.
- */
-#define mb() ((void(*)(void))0xffff0fa0)()
-#define wmb() ((void(*)(void))0xffff0fa0)()
-#define rmb() ((void(*)(void))0xffff0fa0)()
-#define CPUINFO_PROC "Processor"
-#endif
-
-#ifdef __aarch64__
-#define mb() asm volatile("dmb ish" ::: "memory")
-#define wmb() asm volatile("dmb ishst" ::: "memory")
-#define rmb() asm volatile("dmb ishld" ::: "memory")
-#define cpu_relax() asm volatile("yield" ::: "memory")
-#endif
-
-#ifdef __mips__
-#define mb() asm volatile( \
- ".set mips2\n\t" \
- "sync\n\t" \
- ".set mips0" \
- : /* no output */ \
- : /* no input */ \
- : "memory")
-#define wmb() mb()
-#define rmb() mb()
-#define CPUINFO_PROC "cpu model"
-#endif
-
-#ifdef __arc__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "Processor"
-#endif
-
-#ifdef __metag__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "CPU"
-#endif
-
-#ifdef __xtensa__
-#define mb() asm volatile("memw" ::: "memory")
-#define wmb() asm volatile("memw" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "core ID"
-#endif
-
-#ifdef __tile__
-#define mb() asm volatile ("mf" ::: "memory")
-#define wmb() asm volatile ("mf" ::: "memory")
-#define rmb() asm volatile ("mf" ::: "memory")
-#define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
-#define CPUINFO_PROC "model name"
-#endif
-
-#define barrier() asm volatile ("" ::: "memory")
-
-#ifndef cpu_relax
-#define cpu_relax() barrier()
-#endif
+#include "perf-sys.h"
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Move syscall and arch specific defines from perf.h
2014-05-05 12:33 ` [PATCH 08/10] perf tools: Move syscall and arch specific defines " Jiri Olsa
@ 2014-05-05 17:49 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:49 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 43599d1f7adffbbf990b00716ba22974ec1487be
Gitweb: http://git.kernel.org/tip/43599d1f7adffbbf990b00716ba22974ec1487be
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:53:20 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:48:28 +0200
perf tools: Move syscall and arch specific defines from perf.h
Into new perf-sys.h header.
The main reason is to separate system specific perf data
from perf tool stuff, so it could be used in small test
programs, as requested Peter:
http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
This separation makes the perf.h header more clear.
Requested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-9-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/{perf.h => perf-sys.h} | 89 +-------------------
tools/perf/perf.h | 165 +-------------------------------------
2 files changed, 4 insertions(+), 250 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf-sys.h
similarity index 71%
copy from tools/perf/perf.h
copy to tools/perf/perf-sys.h
index d51a994..4c22c2a 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf-sys.h
@@ -1,5 +1,5 @@
-#ifndef _PERF_PERF_H
-#define _PERF_PERF_H
+#ifndef _PERF_SYS_H
+#define _PERF_SYS_H
#include <asm/unistd.h>
@@ -165,87 +165,4 @@
#define cpu_relax() barrier()
#endif
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
-
-#include <time.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-
-#include <linux/types.h>
-#include <linux/perf_event.h>
-
-#ifndef NSEC_PER_SEC
-# define NSEC_PER_SEC 1000000000ULL
-#endif
-#ifndef NSEC_PER_USEC
-# define NSEC_PER_USEC 1000ULL
-#endif
-
-static inline unsigned long long rdclock(void)
-{
- struct timespec ts;
-
- clock_gettime(CLOCK_MONOTONIC, &ts);
- return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
-}
-
-extern bool test_attr__enabled;
-void test_attr__init(void);
-void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
- int fd, int group_fd, unsigned long flags);
-
-static inline int
-sys_perf_event_open(struct perf_event_attr *attr,
- pid_t pid, int cpu, int group_fd,
- unsigned long flags)
-{
- int fd;
-
- fd = syscall(__NR_perf_event_open, attr, pid, cpu,
- group_fd, flags);
-
- if (unlikely(test_attr__enabled))
- test_attr__open(attr, pid, cpu, fd, group_fd, flags);
-
- return fd;
-}
-
-#define MAX_NR_CPUS 256
-
-extern const char *input_name;
-extern bool perf_host, perf_guest;
-extern const char perf_version_string[];
-
-void pthread__unblock_sigwinch(void);
-
-#include "util/target.h"
-
-struct record_opts {
- struct target target;
- int call_graph;
- bool call_graph_enabled;
- bool group;
- bool inherit_stat;
- bool no_buffering;
- bool no_inherit;
- bool no_inherit_set;
- bool no_samples;
- bool raw_samples;
- bool sample_address;
- bool sample_weight;
- bool sample_time;
- bool period;
- unsigned int freq;
- unsigned int mmap_pages;
- unsigned int user_freq;
- u64 branch_stack;
- u64 default_interval;
- u64 user_interval;
- u16 stack_dump_size;
- bool sample_transaction;
- unsigned initial_delay;
-};
-
-#endif
+#endif /* _PERF_SYS_H */
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index d51a994..ee95965 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,173 +1,10 @@
#ifndef _PERF_PERF_H
#define _PERF_PERF_H
-#include <asm/unistd.h>
-
-#if defined(__i386__)
-#define mb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define wmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define rmb() asm volatile("lock; addl $0,0(%%esp)" ::: "memory")
-#define cpu_relax() asm volatile("rep; nop" ::: "memory");
-#define CPUINFO_PROC "model name"
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 336
-#endif
-#ifndef __NR_futex
-# define __NR_futex 240
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 224
-#endif
-#endif
-
-#if defined(__x86_64__)
-#define mb() asm volatile("mfence" ::: "memory")
-#define wmb() asm volatile("sfence" ::: "memory")
-#define rmb() asm volatile("lfence" ::: "memory")
-#define cpu_relax() asm volatile("rep; nop" ::: "memory");
-#define CPUINFO_PROC "model name"
-#ifndef __NR_perf_event_open
-# define __NR_perf_event_open 298
-#endif
-#ifndef __NR_futex
-# define __NR_futex 202
-#endif
-#ifndef __NR_gettid
-# define __NR_gettid 186
-#endif
-#endif
-
-#ifdef __powerpc__
-#include "../../arch/powerpc/include/uapi/asm/unistd.h"
-#define mb() asm volatile ("sync" ::: "memory")
-#define wmb() asm volatile ("sync" ::: "memory")
-#define rmb() asm volatile ("sync" ::: "memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __s390__
-#define mb() asm volatile("bcr 15,0" ::: "memory")
-#define wmb() asm volatile("bcr 15,0" ::: "memory")
-#define rmb() asm volatile("bcr 15,0" ::: "memory")
-#endif
-
-#ifdef __sh__
-#if defined(__SH4A__) || defined(__SH5__)
-# define mb() asm volatile("synco" ::: "memory")
-# define wmb() asm volatile("synco" ::: "memory")
-# define rmb() asm volatile("synco" ::: "memory")
-#else
-# define mb() asm volatile("" ::: "memory")
-# define wmb() asm volatile("" ::: "memory")
-# define rmb() asm volatile("" ::: "memory")
-#endif
-#define CPUINFO_PROC "cpu type"
-#endif
-
-#ifdef __hppa__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __sparc__
-#ifdef __LP64__
-#define mb() asm volatile("ba,pt %%xcc, 1f\n" \
- "membar #StoreLoad\n" \
- "1:\n":::"memory")
-#else
-#define mb() asm volatile("":::"memory")
-#endif
-#define wmb() asm volatile("":::"memory")
-#define rmb() asm volatile("":::"memory")
-#define CPUINFO_PROC "cpu"
-#endif
-
-#ifdef __alpha__
-#define mb() asm volatile("mb" ::: "memory")
-#define wmb() asm volatile("wmb" ::: "memory")
-#define rmb() asm volatile("mb" ::: "memory")
-#define CPUINFO_PROC "cpu model"
-#endif
-
-#ifdef __ia64__
-#define mb() asm volatile ("mf" ::: "memory")
-#define wmb() asm volatile ("mf" ::: "memory")
-#define rmb() asm volatile ("mf" ::: "memory")
-#define cpu_relax() asm volatile ("hint @pause" ::: "memory")
-#define CPUINFO_PROC "model name"
-#endif
-
-#ifdef __arm__
-/*
- * Use the __kuser_memory_barrier helper in the CPU helper page. See
- * arch/arm/kernel/entry-armv.S in the kernel source for details.
- */
-#define mb() ((void(*)(void))0xffff0fa0)()
-#define wmb() ((void(*)(void))0xffff0fa0)()
-#define rmb() ((void(*)(void))0xffff0fa0)()
-#define CPUINFO_PROC "Processor"
-#endif
-
-#ifdef __aarch64__
-#define mb() asm volatile("dmb ish" ::: "memory")
-#define wmb() asm volatile("dmb ishst" ::: "memory")
-#define rmb() asm volatile("dmb ishld" ::: "memory")
-#define cpu_relax() asm volatile("yield" ::: "memory")
-#endif
-
-#ifdef __mips__
-#define mb() asm volatile( \
- ".set mips2\n\t" \
- "sync\n\t" \
- ".set mips0" \
- : /* no output */ \
- : /* no input */ \
- : "memory")
-#define wmb() mb()
-#define rmb() mb()
-#define CPUINFO_PROC "cpu model"
-#endif
-
-#ifdef __arc__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "Processor"
-#endif
-
-#ifdef __metag__
-#define mb() asm volatile("" ::: "memory")
-#define wmb() asm volatile("" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "CPU"
-#endif
-
-#ifdef __xtensa__
-#define mb() asm volatile("memw" ::: "memory")
-#define wmb() asm volatile("memw" ::: "memory")
-#define rmb() asm volatile("" ::: "memory")
-#define CPUINFO_PROC "core ID"
-#endif
-
-#ifdef __tile__
-#define mb() asm volatile ("mf" ::: "memory")
-#define wmb() asm volatile ("mf" ::: "memory")
-#define rmb() asm volatile ("mf" ::: "memory")
-#define cpu_relax() asm volatile ("mfspr zero, PASS" ::: "memory")
-#define CPUINFO_PROC "model name"
-#endif
-
-#define barrier() asm volatile ("" ::: "memory")
-
-#ifndef cpu_relax
-#define cpu_relax() barrier()
-#endif
+#include "perf-sys.h"
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
#include <time.h>
#include <unistd.h>
#include <sys/types.h>
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 09/10] perf tools: Move sys_perf_event_open function from perf.h
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (7 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 08/10] perf tools: Move syscall and arch specific defines " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 17:49 ` [tip:perf/core] " tip-bot for Jiri Olsa
2014-05-05 12:33 ` [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header Jiri Olsa
` (2 subsequent siblings)
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Borislav Petkov,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
Into perf-sys.h header, as requested by Peter:
http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
Adding HAVE_ATTR_TEST define to turn off/on the attribute
test code in the sys_perf_event_open function.
Requested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf-sys.h | 22 ++++++++++++++++++++++
tools/perf/perf.h | 40 +++++++++++-----------------------------
2 files changed, 33 insertions(+), 29 deletions(-)
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index 4c22c2a..5268a14 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -1,6 +1,11 @@
#ifndef _PERF_SYS_H
#define _PERF_SYS_H
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <linux/types.h>
+#include <linux/perf_event.h>
#include <asm/unistd.h>
#if defined(__i386__)
@@ -165,4 +170,21 @@
#define cpu_relax() barrier()
#endif
+static inline int
+sys_perf_event_open(struct perf_event_attr *attr,
+ pid_t pid, int cpu, int group_fd,
+ unsigned long flags)
+{
+ int fd;
+
+ fd = syscall(__NR_perf_event_open, attr, pid, cpu,
+ group_fd, flags);
+
+#ifdef HAVE_ATTR_TEST
+ if (unlikely(test_attr__enabled))
+ test_attr__open(attr, pid, cpu, fd, group_fd, flags);
+#endif
+ return fd;
+}
+
#endif /* _PERF_SYS_H */
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index ee95965..813571b 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,18 +1,21 @@
#ifndef _PERF_PERF_H
#define _PERF_PERF_H
-#include "perf-sys.h"
-
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
#include <time.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-
+#include <stdbool.h>
#include <linux/types.h>
#include <linux/perf_event.h>
+extern bool test_attr__enabled;
+void test_attr__init(void);
+void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
+ int fd, int group_fd, unsigned long flags);
+
+#define HAVE_ATTR_TEST
+#include "perf-sys.h"
+
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+
#ifndef NSEC_PER_SEC
# define NSEC_PER_SEC 1000000000ULL
#endif
@@ -28,27 +31,6 @@ static inline unsigned long long rdclock(void)
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
-extern bool test_attr__enabled;
-void test_attr__init(void);
-void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
- int fd, int group_fd, unsigned long flags);
-
-static inline int
-sys_perf_event_open(struct perf_event_attr *attr,
- pid_t pid, int cpu, int group_fd,
- unsigned long flags)
-{
- int fd;
-
- fd = syscall(__NR_perf_event_open, attr, pid, cpu,
- group_fd, flags);
-
- if (unlikely(test_attr__enabled))
- test_attr__open(attr, pid, cpu, fd, group_fd, flags);
-
- return fd;
-}
-
#define MAX_NR_CPUS 256
extern const char *input_name;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* [tip:perf/core] perf tools: Move sys_perf_event_open function from perf.h
2014-05-05 12:33 ` [PATCH 09/10] perf tools: Move sys_perf_event_open function " Jiri Olsa
@ 2014-05-05 17:49 ` tip-bot for Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: tip-bot for Jiri Olsa @ 2014-05-05 17:49 UTC (permalink / raw)
To: linux-tip-commits
Cc: linux-kernel, paulus, acme, hpa, mingo, jolsa, a.p.zijlstra,
peterz, acme, namhyung, fweisbec, dsahern, tglx, cjashfor, bp
Commit-ID: 82baa0eb46c15b749723d0c801470fea044657d7
Gitweb: http://git.kernel.org/tip/82baa0eb46c15b749723d0c801470fea044657d7
Author: Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 5 May 2014 12:58:31 +0200
Committer: Jiri Olsa <jolsa@kernel.org>
CommitDate: Mon, 5 May 2014 17:48:51 +0200
perf tools: Move sys_perf_event_open function from perf.h
Into perf-sys.h header, as requested by Peter:
http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
Adding HAVE_ATTR_TEST define to turn off/on the attribute
test code in the sys_perf_event_open function.
Requested-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Borislav Petkov <bp@suse.de>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1399293219-8732-10-git-send-email-jolsa@kernel.org
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf-sys.h | 22 ++++++++++++++++++++++
tools/perf/perf.h | 40 +++++++++++-----------------------------
2 files changed, 33 insertions(+), 29 deletions(-)
diff --git a/tools/perf/perf-sys.h b/tools/perf/perf-sys.h
index 4c22c2a..5268a14 100644
--- a/tools/perf/perf-sys.h
+++ b/tools/perf/perf-sys.h
@@ -1,6 +1,11 @@
#ifndef _PERF_SYS_H
#define _PERF_SYS_H
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+#include <linux/types.h>
+#include <linux/perf_event.h>
#include <asm/unistd.h>
#if defined(__i386__)
@@ -165,4 +170,21 @@
#define cpu_relax() barrier()
#endif
+static inline int
+sys_perf_event_open(struct perf_event_attr *attr,
+ pid_t pid, int cpu, int group_fd,
+ unsigned long flags)
+{
+ int fd;
+
+ fd = syscall(__NR_perf_event_open, attr, pid, cpu,
+ group_fd, flags);
+
+#ifdef HAVE_ATTR_TEST
+ if (unlikely(test_attr__enabled))
+ test_attr__open(attr, pid, cpu, fd, group_fd, flags);
+#endif
+ return fd;
+}
+
#endif /* _PERF_SYS_H */
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index ee95965..813571b 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -1,18 +1,21 @@
#ifndef _PERF_PERF_H
#define _PERF_PERF_H
-#include "perf-sys.h"
-
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
#include <time.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/syscall.h>
-
+#include <stdbool.h>
#include <linux/types.h>
#include <linux/perf_event.h>
+extern bool test_attr__enabled;
+void test_attr__init(void);
+void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
+ int fd, int group_fd, unsigned long flags);
+
+#define HAVE_ATTR_TEST
+#include "perf-sys.h"
+
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+
#ifndef NSEC_PER_SEC
# define NSEC_PER_SEC 1000000000ULL
#endif
@@ -28,27 +31,6 @@ static inline unsigned long long rdclock(void)
return ts.tv_sec * 1000000000ULL + ts.tv_nsec;
}
-extern bool test_attr__enabled;
-void test_attr__init(void);
-void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
- int fd, int group_fd, unsigned long flags);
-
-static inline int
-sys_perf_event_open(struct perf_event_attr *attr,
- pid_t pid, int cpu, int group_fd,
- unsigned long flags)
-{
- int fd;
-
- fd = syscall(__NR_perf_event_open, attr, pid, cpu,
- group_fd, flags);
-
- if (unlikely(test_attr__enabled))
- test_attr__open(attr, pid, cpu, fd, group_fd, flags);
-
- return fd;
-}
-
#define MAX_NR_CPUS 256
extern const char *input_name;
^ permalink raw reply related [flat|nested] 26+ messages in thread
* [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (8 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 09/10] perf tools: Move sys_perf_event_open function " Jiri Olsa
@ 2014-05-05 12:33 ` Jiri Olsa
2014-05-05 12:45 ` Peter Zijlstra
2014-05-05 12:46 ` [PATCH 00/10] perf tools: perf.h cleanups Peter Zijlstra
2014-05-05 13:49 ` Arnaldo Carvalho de Melo
11 siblings, 1 reply; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 12:33 UTC (permalink / raw)
To: linux-kernel
Cc: Jiri Olsa, Arnaldo Carvalho de Melo, Corey Ashford,
Borislav Petkov, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras, Peter Zijlstra
Into util/evlist.h header as it's the only user
of this define.
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Borislav Petkov <bp@suse.de>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
---
tools/perf/perf.h | 2 --
tools/perf/util/evlist.h | 2 ++
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/perf/perf.h b/tools/perf/perf.h
index 813571b..510c65f 100644
--- a/tools/perf/perf.h
+++ b/tools/perf/perf.h
@@ -14,8 +14,6 @@ void test_attr__open(struct perf_event_attr *attr, pid_t pid, int cpu,
#define HAVE_ATTR_TEST
#include "perf-sys.h"
-#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
-
#ifndef NSEC_PER_SEC
# define NSEC_PER_SEC 1000000000ULL
#endif
diff --git a/tools/perf/util/evlist.h b/tools/perf/util/evlist.h
index f5173cd..fa77cd7 100644
--- a/tools/perf/util/evlist.h
+++ b/tools/perf/util/evlist.h
@@ -17,6 +17,8 @@ struct record_opts;
#define PERF_EVLIST__HLIST_BITS 8
#define PERF_EVLIST__HLIST_SIZE (1 << PERF_EVLIST__HLIST_BITS)
+#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))
+
struct perf_mmap {
void *base;
int mask;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header
2014-05-05 12:33 ` [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header Jiri Olsa
@ 2014-05-05 12:45 ` Peter Zijlstra
2014-05-05 12:59 ` Borislav Petkov
0 siblings, 1 reply; 26+ messages in thread
From: Peter Zijlstra @ 2014-05-05 12:45 UTC (permalink / raw)
To: Jiri Olsa
Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
Borislav Petkov, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras
On Mon, May 05, 2014 at 02:33:39PM +0200, Jiri Olsa wrote:
> Into util/evlist.h header as it's the only user
> of this define.
One could argue its part of the barrier muck, but sure.
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header
2014-05-05 12:45 ` Peter Zijlstra
@ 2014-05-05 12:59 ` Borislav Petkov
2014-05-05 13:13 ` Jiri Olsa
0 siblings, 1 reply; 26+ messages in thread
From: Borislav Petkov @ 2014-05-05 12:59 UTC (permalink / raw)
To: Peter Zijlstra
Cc: Jiri Olsa, linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
Paul Mackerras
On Mon, May 05, 2014 at 02:45:36PM +0200, Peter Zijlstra wrote:
> One could argue its part of the barrier muck, but sure.
Yeah, it might be prudent to put stuff like that in the most fitting
headers from the get-go as it causes trouble otherwise. And for
ACCESS_ONCE, in particular, we have tools/include/linux/compiler.h which
is a subset of include/linux/compiler.h so maybe it should go there.
Btw, why aren't we simply including include/linux/compiler.h
in tools/include/linux/compiler.h and be done with the whole
compiler-related stuff?
--
Regards/Gruss,
Boris.
Sent from a fat crate under my desk. Formatting is fine.
--
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header
2014-05-05 12:59 ` Borislav Petkov
@ 2014-05-05 13:13 ` Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 13:13 UTC (permalink / raw)
To: Borislav Petkov
Cc: Peter Zijlstra, Jiri Olsa, linux-kernel, Arnaldo Carvalho de Melo,
Corey Ashford, David Ahern, Frederic Weisbecker, Ingo Molnar,
Namhyung Kim, Paul Mackerras
On Mon, May 05, 2014 at 02:59:22PM +0200, Borislav Petkov wrote:
> On Mon, May 05, 2014 at 02:45:36PM +0200, Peter Zijlstra wrote:
> > One could argue its part of the barrier muck, but sure.
>
> Yeah, it might be prudent to put stuff like that in the most fitting
> headers from the get-go as it causes trouble otherwise. And for
> ACCESS_ONCE, in particular, we have tools/include/linux/compiler.h which
> is a subset of include/linux/compiler.h so maybe it should go there.
right, that sounds like better place, I'll put it there
thanks,
jirka
^ permalink raw reply [flat|nested] 26+ messages in thread
* Re: [PATCH 00/10] perf tools: perf.h cleanups
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (9 preceding siblings ...)
2014-05-05 12:33 ` [PATCH 10/10] perf tools: Move ACCESS_ONCE from perf.h header Jiri Olsa
@ 2014-05-05 12:46 ` Peter Zijlstra
2014-05-05 13:49 ` Arnaldo Carvalho de Melo
11 siblings, 0 replies; 26+ messages in thread
From: Peter Zijlstra @ 2014-05-05 12:46 UTC (permalink / raw)
To: Jiri Olsa
Cc: linux-kernel, Arnaldo Carvalho de Melo, Corey Ashford,
David Ahern, Frederic Weisbecker, Ingo Molnar, Namhyung Kim,
Paul Mackerras
On Mon, May 05, 2014 at 02:33:29PM +0200, Jiri Olsa wrote:
> hi,
> moving syscall function and arch related defines into
> new header 'perf-sys.h' as requested by Peter in:
> http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
>
> While at it I did some clean ups in perf.h header.
>
> Hopefully I did not brake anyone's usage of
> perf.h .. let me know ;-)
break, brake is to slow down, also possibly appropriate ;-)
Thanks!
Acked-by: Peter Zijlstra <peterz@infradead.org>
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 00/10] perf tools: perf.h cleanups
2014-05-05 12:33 [PATCH 00/10] perf tools: perf.h cleanups Jiri Olsa
` (10 preceding siblings ...)
2014-05-05 12:46 ` [PATCH 00/10] perf tools: perf.h cleanups Peter Zijlstra
@ 2014-05-05 13:49 ` Arnaldo Carvalho de Melo
2014-05-05 13:59 ` Jiri Olsa
11 siblings, 1 reply; 26+ messages in thread
From: Arnaldo Carvalho de Melo @ 2014-05-05 13:49 UTC (permalink / raw)
To: Jiri Olsa
Cc: linux-kernel, Corey Ashford, David Ahern, Frederic Weisbecker,
Ingo Molnar, Namhyung Kim, Paul Mackerras, Peter Zijlstra
Em Mon, May 05, 2014 at 02:33:29PM +0200, Jiri Olsa escreveu:
> hi,
> moving syscall function and arch related defines into
> new header 'perf-sys.h' as requested by Peter in:
> http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
>
> While at it I did some clean ups in perf.h header.
>
> Hopefully I did not brake anyone's usage of
> perf.h .. let me know ;-)
>
> Also available in here:
> git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> perf/header_1
With that ACCESS_ONCE comments made addressed:
Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
- Arnaldo
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 00/10] perf tools: perf.h cleanups
2014-05-05 13:49 ` Arnaldo Carvalho de Melo
@ 2014-05-05 13:59 ` Jiri Olsa
0 siblings, 0 replies; 26+ messages in thread
From: Jiri Olsa @ 2014-05-05 13:59 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo
Cc: Jiri Olsa, linux-kernel, Corey Ashford, David Ahern,
Frederic Weisbecker, Ingo Molnar, Namhyung Kim, Paul Mackerras,
Peter Zijlstra
On Mon, May 05, 2014 at 10:49:34AM -0300, Arnaldo Carvalho de Melo wrote:
> Em Mon, May 05, 2014 at 02:33:29PM +0200, Jiri Olsa escreveu:
> > hi,
> > moving syscall function and arch related defines into
> > new header 'perf-sys.h' as requested by Peter in:
> > http://lkml.kernel.org/r/20140502115201.GI30445@twins.programming.kicks-ass.net
> >
> > While at it I did some clean ups in perf.h header.
> >
> > Hopefully I did not brake anyone's usage of
> > perf.h .. let me know ;-)
> >
> > Also available in here:
> > git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
> > perf/header_1
>
> With that ACCESS_ONCE comments made addressed:
>
> Acked-by: Arnaldo Carvalho de Melo <acme@redhat.com>
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeey ;-)
welcome back!!!
jirka
^ permalink raw reply [flat|nested] 26+ messages in thread