mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-21 22:21:21 +00:00
Merge branch 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip: (28 commits) ftrace: Add function names to dangling } in function graph tracer tracing: Simplify memory recycle of trace_define_field tracing: Remove unnecessary variable in print_graph_return tracing: Fix typo of info text in trace_kprobe.c tracing: Fix typo in prof_sysexit_enable() tracing: Remove CONFIG_TRACE_POWER from kernel config tracing: Fix ftrace_event_call alignment for use with gcc 4.5 ftrace: Remove memory barriers from NMI code when not needed tracing/kprobes: Add short documentation for HAVE_REGS_AND_STACK_ACCESS_API s390: Add pt_regs register and stack access API tracing/kprobes: Make Kconfig dependencies generic tracing: Unify arch_syscall_addr() implementations tracing: Add notrace to TRACE_EVENT implementation functions ftrace: Allow to remove a single function from function graph filter tracing: Add correct/incorrect to sort keys for branch annotation output tracing: Simplify test for function_graph tracing start point tracing: Drop the tr check from the graph tracing path tracing: Add stack dump to trace_printk if stacktrace option is set tracing: Use appropriate perl constructs in recordmcount.pl tracing: optimize recordmcount.pl for offsets-handling ...
This commit is contained in:
commit
e0d272429a
30 changed files with 587 additions and 554 deletions
|
@ -136,13 +136,14 @@ my %text_sections = (
|
|||
".text.unlikely" => 1,
|
||||
);
|
||||
|
||||
$objdump = "objdump" if ((length $objdump) == 0);
|
||||
$objcopy = "objcopy" if ((length $objcopy) == 0);
|
||||
$cc = "gcc" if ((length $cc) == 0);
|
||||
$ld = "ld" if ((length $ld) == 0);
|
||||
$nm = "nm" if ((length $nm) == 0);
|
||||
$rm = "rm" if ((length $rm) == 0);
|
||||
$mv = "mv" if ((length $mv) == 0);
|
||||
# Note: we are nice to C-programmers here, thus we skip the '||='-idiom.
|
||||
$objdump = 'objdump' if (!$objdump);
|
||||
$objcopy = 'objcopy' if (!$objcopy);
|
||||
$cc = 'gcc' if (!$cc);
|
||||
$ld = 'ld' if (!$ld);
|
||||
$nm = 'nm' if (!$nm);
|
||||
$rm = 'rm' if (!$rm);
|
||||
$mv = 'mv' if (!$mv);
|
||||
|
||||
#print STDERR "running: $P '$arch' '$objdump' '$objcopy' '$cc' '$ld' " .
|
||||
# "'$nm' '$rm' '$mv' '$inputfile'\n";
|
||||
|
@ -432,14 +433,14 @@ sub update_funcs
|
|||
|
||||
# Loop through all the mcount caller offsets and print a reference
|
||||
# to the caller based from the ref_func.
|
||||
for (my $i=0; $i <= $#offsets; $i++) {
|
||||
if (!$opened) {
|
||||
open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
|
||||
$opened = 1;
|
||||
print FILE "\t.section $mcount_section,\"a\",$section_type\n";
|
||||
print FILE "\t.align $alignment\n" if (defined($alignment));
|
||||
}
|
||||
printf FILE "\t%s %s + %d\n", $type, $ref_func, $offsets[$i] - $offset;
|
||||
if (!$opened) {
|
||||
open(FILE, ">$mcount_s") || die "can't create $mcount_s\n";
|
||||
$opened = 1;
|
||||
print FILE "\t.section $mcount_section,\"a\",$section_type\n";
|
||||
print FILE "\t.align $alignment\n" if (defined($alignment));
|
||||
}
|
||||
foreach my $cur_offset (@offsets) {
|
||||
printf FILE "\t%s %s + %d\n", $type, $ref_func, $cur_offset - $offset;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -476,11 +477,7 @@ while (<IN>) {
|
|||
$read_headers = 0;
|
||||
|
||||
# Only record text sections that we know are safe
|
||||
if (defined($text_sections{$1})) {
|
||||
$read_function = 1;
|
||||
} else {
|
||||
$read_function = 0;
|
||||
}
|
||||
$read_function = defined($text_sections{$1});
|
||||
# print out any recorded offsets
|
||||
update_funcs();
|
||||
|
||||
|
@ -514,7 +511,7 @@ while (<IN>) {
|
|||
}
|
||||
# is this a call site to mcount? If so, record it to print later
|
||||
if ($text_found && /$mcount_regex/) {
|
||||
$offsets[$#offsets + 1] = hex $1;
|
||||
push(@offsets, hex $1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue