Skip to contentSkip to conversation

ftrace: adding other non-leaving .text sections

PATCH In review Liming Wang 5 participants 8 messages Nov 26, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ftrace: adding other non-leaving .text sections

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

---
 scripts/recordmcount.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
scripts/recordmcount.pl +2 -0
index 0197e2f..0b1dc9f 100755
@@ -112,6 +112,8 @@ my ($arch, $bits, $objdump, $objcopy, $cc,
 # Acceptable sections to record.
 my %text_sections = (
      ".text" => 1,
+     ".sched.text" => 1,
+     ".spinlock.text" => 1,
 );
 
 $objdump = "objdump" if ((length $objdump) == 0);
Signature · 1 line
1.6.0.3
#1 lore raw
Quoted 22 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

---
 scripts/recordmcount.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
scripts/recordmcount.pl +0 -0
index 0197e2f..0b1dc9f 100755

scripts/recordmcount.pl my ($arch, $bits, $objdump, $objcopy, $cc, · line 117

Quoted 6 lines
scripts/recordmcount.pl +2 -0
@@ -112,6 +112,8 @@ my ($arch, $bits, $objdump, $objcopy, $cc,
 # Acceptable sections to record.
 my %text_sections = (
      ".text" => 1,
+     ".sched.text" => 1,
+     ".spinlock.text" => 1,
 );

make sense - applied to tip/tracing/ftrace, thanks!

Ingo

Acked-by on v1 1/1
#2 lore raw
In reply to Liming Wang
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Thanks!

-- Steve

Quoted 24 lines
---
 scripts/recordmcount.pl |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
scripts/recordmcount.pl +2 -0
index 0197e2f..0b1dc9f 100755
@@ -112,6 +112,8 @@ my ($arch, $bits, $objdump, $objcopy, $cc,
 # Acceptable sections to record.
 my %text_sections = (
      ".text" => 1,
+     ".sched.text" => 1,
+     ".spinlock.text" => 1,
 );
 
 $objdump = "objdump" if ((length $objdump) == 0);
Signature · 1 line
1.6.0.3
#3 lore raw
Quoted 15 lines · Steven Rostedt
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Quoted 4 lines

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Does your .text cover .text.head by the way?

#4 lore raw
Quoted 16 lines · Paul Mundt
Quoted 15 lines · Steven Rostedt
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Quoted 5 lines
Quoted 4 lines

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Does your .text cover .text.head by the way?

No, and not needed. Because .text.head is of booting code, to which function tracer can't trace.

walimis

Quoted 5 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#5 lore raw
Quoted 17 lines · walimis
Quoted 16 lines · Paul Mundt
Quoted 15 lines · Steven Rostedt
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Quoted 8 lines
Quoted 5 lines
Quoted 4 lines

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Does your .text cover .text.head by the way?

No, and not needed. Because .text.head is of booting code, to which function tracer can't trace.

In the case of CPU hotplug it can be entered at any time. I don't see why it can't be traced from the boot CPU at least.

#6 lore raw
Quoted 22 lines · Paul Mundt
Quoted 21 lines · walimis
Quoted 20 lines · Paul Mundt
Quoted 19 lines · Steven Rostedt
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Does your .text cover .text.head by the way?

No, and not needed. Because .text.head is of booting code, to which function tracer can't trace.

In the case of CPU hotplug it can be entered at any time. I don't see why it can't be traced from the boot CPU at least.

OK, I see. Need more investigating on it.
Thanks.

#7 lore raw
In reply to Paul Mundt
Quoted 16 lines · Paul Mundt
Quoted 15 lines · Steven Rostedt
Quoted 11 lines · Liming Wang

Please review this patch, and I don't know whether new sections will conflict with sched tracer or others.
This patch is against Steven tree's tip/devel latest commit.

Impact: improve recordmcount.pl

Besides .text section, there are three .text sections that won't be freed after kernel booting. They are: .sched.text, .spinlock.text and .kprobes.text, which contain functions we can trace. But the last section ".kprobes.text" is particular, which has been marked as "notrace", we ignore it. Thus we add other two sections.

Quoted 5 lines
Quoted 4 lines

Yep, only those sections that we know will not disappear are OK. I was conservative with only using ".text" but I knew there were other sections that were OK, so I used the hash array to make it easy to add others.

Does your .text cover .text.head by the way?

No, you can add it if it is safe to trace, and it will not ever disappear.

-- Steve