Skip to contentSkip to conversation

perf: Only include tsc file for x86

PATCH In review David Ahern 4 participants 6 messages Feb 19, 2015 – Mar 3, 2015 perf events

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 perf: Only include tsc file for x86

perf_time_to_tsc and tsc_to_perf_time are only used for x86. Make inclusion of tsc.c dependent on x86 as well.

Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index 32f9327b1a97..4c7095785ba0 100644
@@ -71,7 +71,7 @@ libperf-y += stat.o
 libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
-libperf-y += tsc.o
+libperf-$(CONFIG_X86) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 
Signature · 1 line
1.9.3
#1 lore raw
Quoted 2 lines · David Ahern

perf_time_to_tsc and tsc_to_perf_time are only used for x86. Make inclusion of tsc.c dependent on x86 as well.

hum, should we move it to arch/x86/util/tsc.c and remove util/tsc.c?

looks like it's used only by test tsc code, which is enabled for x86 only anyway..

jirka

Quoted 24 lines
Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index 32f9327b1a97..4c7095785ba0 100644
@@ -71,7 +71,7 @@ libperf-y += stat.o
 libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
-libperf-y += tsc.o
+libperf-$(CONFIG_X86) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 
Signature · 1 line
1.9.3
reviewer
#2 lore raw
Quoted 5 lines · Jiri Olsa
Quoted 2 lines · David Ahern

perf_time_to_tsc and tsc_to_perf_time are only used for x86. Make inclusion of tsc.c dependent on x86 as well.

hum, should we move it to arch/x86/util/tsc.c and remove util/tsc.c?

It is not arch-specific because you can read a perf.data file from one architecture on another architecture.

The TSC stuff was planned for Intel PT although it might now be done differently.

Probably you should have CONFIG_X86_TSC and then select that with CONFIG_X86. Later it can be selected with CONFIG_INTEL_PT as well.

Quoted 32 lines

looks like it's used only by test tsc code, which is enabled for x86 only anyway..

jirka

Quoted 24 lines
Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index 32f9327b1a97..4c7095785ba0 100644
@@ -71,7 +71,7 @@ libperf-y += stat.o
 libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
-libperf-y += tsc.o
+libperf-$(CONFIG_X86) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o
 
Signature · 1 line
1.9.3
#3 lore raw
Quoted 10 lines · Adrian Hunter
Quoted 5 lines · Jiri Olsa
Quoted 2 lines · David Ahern

perf_time_to_tsc and tsc_to_perf_time are only used for x86. Make inclusion of tsc.c dependent on x86 as well.

hum, should we move it to arch/x86/util/tsc.c and remove util/tsc.c?

It is not arch-specific because you can read a perf.data file from one architecture on another architecture.

Quoted 6 lines

The TSC stuff was planned for Intel PT although it might now be done differently.

Probably you should have CONFIG_X86_TSC and then select that with CONFIG_X86. Later it can be selected with CONFIG_INTEL_PT as well.

For now let's leave it as CONFIG_X86. Right now only X86 code needs the functions it provides and there is no need taking any other steps until something is going to use it.

ie., patch is good as is. Agreed?

David

Quoted 34 lines
Quoted 33 lines

looks like it's used only by test tsc code, which is enabled for x86 only anyway..

jirka

Quoted 24 lines
Cc Adrian Hunter <[email protected]>
Cc Jiri Olsa <[email protected]>
---
  tools/perf/util/Build | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -2
index 32f9327b1a97..4c7095785ba0 100644
@@ -71,7 +71,7 @@ libperf-y += stat.o
  libperf-y += record.o
  libperf-y += srcline.o
  libperf-y += data.o
-libperf-y += tsc.o
+libperf-$(CONFIG_X86) += tsc.o
  libperf-y += cloexec.o
  libperf-y += thread-stack.o
 
--

1.9.3

#4 lore raw
Quoted 18 lines · David Ahern
Quoted 10 lines · Adrian Hunter
Quoted 5 lines · Jiri Olsa
Quoted 2 lines · David Ahern

perf_time_to_tsc and tsc_to_perf_time are only used for x86. Make inclusion of tsc.c dependent on x86 as well.

hum, should we move it to arch/x86/util/tsc.c and remove util/tsc.c?

It is not arch-specific because you can read a perf.data file from one architecture on another architecture.

Quoted 6 lines

The TSC stuff was planned for Intel PT although it might now be done differently.

Probably you should have CONFIG_X86_TSC and then select that with CONFIG_X86. Later it can be selected with CONFIG_INTEL_PT as well.

Quoted 5 lines

For now let's leave it as CONFIG_X86. Right now only X86 code needs the functions it provides and there is no need taking any other steps until something is going to use it.

ie., patch is good as is. Agreed?

ook, jirka

#5 lore raw

[tip:perf/core] perf tools: Only include tsc file for x86

In reply to David Ahern
perf tools: Only include tsc file for x86
Commit-ID:  ecefde629fadd3fcca2ea4c6a799d6e6aab8781f
Gitweb:     http://git.kernel.org/tip/ecefde629fadd3fcca2ea4c6a799d6e6aab8781f
Author:     David Ahern <[email protected]>
AuthorDate: Thu, 19 Feb 2015 13:22:33 -0500
Committer:  Arnaldo Carvalho de Melo <[email protected]>
CommitDate: Mon, 2 Mar 2015 11:50:08 -0300

perf tools: Only include tsc file for x86

The perf_time_to_tsc and tsc_to_perf_time functions are only used for x86.

Make inclusion of tsc.c dependent on x86 as well.

---
 tools/perf/util/Build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/util/Build +1 -1
index a2c8047..972a6e0 100644
@@ -71,7 +71,7 @@ libperf-y += stat.o
 libperf-y += record.o
 libperf-y += srcline.o
 libperf-y += data.o
-libperf-y += tsc.o
+libperf-$(CONFIG_X86) += tsc.o
 libperf-y += cloexec.o
 libperf-y += thread-stack.o