diff options
author | Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> | 2010-12-17 08:12:11 -0500 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2010-12-21 17:20:58 -0500 |
commit | 0e43e5d222095ca2d1d825dd2e4fa158bdc4cc9b (patch) | |
tree | 2fa6d24d7e3fdb366bd070e2068b059fad5c0fd5 /tools/perf/util/probe-finder.c | |
parent | ec5761eab318e50e69fcf8e63e9edaef5949c067 (diff) |
perf probe: Cleanup messages
Add new lines for error or debug messages, change dwarf related words to more
generic words (or just removed).
Cc: 2nddept-manager@sdl.hitachi.co.jp
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
LKML-Reference: <20101217131211.24123.40437.stgit@ltc236.sdl.hitachi.co.jp>
Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/probe-finder.c')
-rw-r--r-- | tools/perf/util/probe-finder.c | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index 3991d73d1cff..90b629226bd7 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c | |||
@@ -627,8 +627,8 @@ static_var: | |||
627 | regs = get_arch_regstr(regn); | 627 | regs = get_arch_regstr(regn); |
628 | if (!regs) { | 628 | if (!regs) { |
629 | /* This should be a bug in DWARF or this tool */ | 629 | /* This should be a bug in DWARF or this tool */ |
630 | pr_warning("Mapping for DWARF register number %u " | 630 | pr_warning("Mapping for the register number %u " |
631 | "missing on this architecture.", regn); | 631 | "missing on this architecture.\n", regn); |
632 | return -ERANGE; | 632 | return -ERANGE; |
633 | } | 633 | } |
634 | 634 | ||
@@ -674,13 +674,14 @@ static int convert_variable_type(Dwarf_Die *vr_die, | |||
674 | if (ret != DW_TAG_pointer_type && | 674 | if (ret != DW_TAG_pointer_type && |
675 | ret != DW_TAG_array_type) { | 675 | ret != DW_TAG_array_type) { |
676 | pr_warning("Failed to cast into string: " | 676 | pr_warning("Failed to cast into string: " |
677 | "%s(%s) is not a pointer nor array.", | 677 | "%s(%s) is not a pointer nor array.\n", |
678 | dwarf_diename(vr_die), dwarf_diename(&type)); | 678 | dwarf_diename(vr_die), dwarf_diename(&type)); |
679 | return -EINVAL; | 679 | return -EINVAL; |
680 | } | 680 | } |
681 | if (ret == DW_TAG_pointer_type) { | 681 | if (ret == DW_TAG_pointer_type) { |
682 | if (die_get_real_type(&type, &type) == NULL) { | 682 | if (die_get_real_type(&type, &type) == NULL) { |
683 | pr_warning("Failed to get a type information."); | 683 | pr_warning("Failed to get a type" |
684 | " information.\n"); | ||
684 | return -ENOENT; | 685 | return -ENOENT; |
685 | } | 686 | } |
686 | while (*ref_ptr) | 687 | while (*ref_ptr) |
@@ -695,7 +696,7 @@ static int convert_variable_type(Dwarf_Die *vr_die, | |||
695 | if (!die_compare_name(&type, "char") && | 696 | if (!die_compare_name(&type, "char") && |
696 | !die_compare_name(&type, "unsigned char")) { | 697 | !die_compare_name(&type, "unsigned char")) { |
697 | pr_warning("Failed to cast into string: " | 698 | pr_warning("Failed to cast into string: " |
698 | "%s is not (unsigned) char *.", | 699 | "%s is not (unsigned) char *.\n", |
699 | dwarf_diename(vr_die)); | 700 | dwarf_diename(vr_die)); |
700 | return -EINVAL; | 701 | return -EINVAL; |
701 | } | 702 | } |
@@ -805,8 +806,8 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, | |||
805 | return -EINVAL; | 806 | return -EINVAL; |
806 | } | 807 | } |
807 | if (field->name[0] == '[') { | 808 | if (field->name[0] == '[') { |
808 | pr_err("Semantic error: %s is not a pointor nor array.", | 809 | pr_err("Semantic error: %s is not a pointor" |
809 | varname); | 810 | " nor array.\n", varname); |
810 | return -EINVAL; | 811 | return -EINVAL; |
811 | } | 812 | } |
812 | if (field->ref) { | 813 | if (field->ref) { |
@@ -953,7 +954,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, | |||
953 | name = dwarf_diename(sp_die); | 954 | name = dwarf_diename(sp_die); |
954 | if (name) { | 955 | if (name) { |
955 | if (dwarf_entrypc(sp_die, &eaddr) != 0) { | 956 | if (dwarf_entrypc(sp_die, &eaddr) != 0) { |
956 | pr_warning("Failed to get entry pc of %s\n", | 957 | pr_warning("Failed to get entry address of %s\n", |
957 | dwarf_diename(sp_die)); | 958 | dwarf_diename(sp_die)); |
958 | return -ENOENT; | 959 | return -ENOENT; |
959 | } | 960 | } |
@@ -969,7 +970,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, | |||
969 | if (retprobe) { | 970 | if (retprobe) { |
970 | if (eaddr != paddr) { | 971 | if (eaddr != paddr) { |
971 | pr_warning("Return probe must be on the head of" | 972 | pr_warning("Return probe must be on the head of" |
972 | " a real function\n"); | 973 | " a real function.\n"); |
973 | return -EINVAL; | 974 | return -EINVAL; |
974 | } | 975 | } |
975 | tp->retprobe = true; | 976 | tp->retprobe = true; |
@@ -1008,7 +1009,7 @@ static int call_probe_finder(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
1008 | Dwarf_Frame *frame; | 1009 | Dwarf_Frame *frame; |
1009 | if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || | 1010 | if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || |
1010 | dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { | 1011 | dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { |
1011 | pr_warning("Failed to get CFA on 0x%jx\n", | 1012 | pr_warning("Failed to get call frame on 0x%jx\n", |
1012 | (uintmax_t)pf->addr); | 1013 | (uintmax_t)pf->addr); |
1013 | return -ENOENT; | 1014 | return -ENOENT; |
1014 | } | 1015 | } |
@@ -1035,7 +1036,7 @@ static int find_probe_point_by_line(struct probe_finder *pf) | |||
1035 | int ret = 0; | 1036 | int ret = 0; |
1036 | 1037 | ||
1037 | if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { | 1038 | if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { |
1038 | pr_warning("No source lines found in this CU.\n"); | 1039 | pr_warning("No source lines found.\n"); |
1039 | return -ENOENT; | 1040 | return -ENOENT; |
1040 | } | 1041 | } |
1041 | 1042 | ||
@@ -1137,7 +1138,7 @@ static int find_probe_point_lazy(Dwarf_Die *sp_die, struct probe_finder *pf) | |||
1137 | } | 1138 | } |
1138 | 1139 | ||
1139 | if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { | 1140 | if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { |
1140 | pr_warning("No source lines found in this CU.\n"); | 1141 | pr_warning("No source lines found.\n"); |
1141 | return -ENOENT; | 1142 | return -ENOENT; |
1142 | } | 1143 | } |
1143 | 1144 | ||
@@ -1195,7 +1196,7 @@ static int probe_point_inline_cb(Dwarf_Die *in_die, void *data) | |||
1195 | else { | 1196 | else { |
1196 | /* Get probe address */ | 1197 | /* Get probe address */ |
1197 | if (dwarf_entrypc(in_die, &addr) != 0) { | 1198 | if (dwarf_entrypc(in_die, &addr) != 0) { |
1198 | pr_warning("Failed to get entry pc of %s.\n", | 1199 | pr_warning("Failed to get entry address of %s.\n", |
1199 | dwarf_diename(in_die)); | 1200 | dwarf_diename(in_die)); |
1200 | param->retval = -ENOENT; | 1201 | param->retval = -ENOENT; |
1201 | return DWARF_CB_ABORT; | 1202 | return DWARF_CB_ABORT; |
@@ -1236,8 +1237,8 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data) | |||
1236 | param->retval = find_probe_point_lazy(sp_die, pf); | 1237 | param->retval = find_probe_point_lazy(sp_die, pf); |
1237 | else { | 1238 | else { |
1238 | if (dwarf_entrypc(sp_die, &pf->addr) != 0) { | 1239 | if (dwarf_entrypc(sp_die, &pf->addr) != 0) { |
1239 | pr_warning("Failed to get entry pc of %s.\n", | 1240 | pr_warning("Failed to get entry address of " |
1240 | dwarf_diename(sp_die)); | 1241 | "%s.\n", dwarf_diename(sp_die)); |
1241 | param->retval = -ENOENT; | 1242 | param->retval = -ENOENT; |
1242 | return DWARF_CB_ABORT; | 1243 | return DWARF_CB_ABORT; |
1243 | } | 1244 | } |
@@ -1279,7 +1280,7 @@ static int find_probes(int fd, struct probe_finder *pf) | |||
1279 | 1280 | ||
1280 | dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); | 1281 | dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); |
1281 | if (!dbg) { | 1282 | if (!dbg) { |
1282 | pr_warning("No dwarf info found in the vmlinux - " | 1283 | pr_warning("No debug information found in the vmlinux - " |
1283 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); | 1284 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); |
1284 | return -EBADF; | 1285 | return -EBADF; |
1285 | } | 1286 | } |
@@ -1524,7 +1525,7 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt) | |||
1524 | /* Open the live linux kernel */ | 1525 | /* Open the live linux kernel */ |
1525 | dbg = dwfl_init_live_kernel_dwarf(addr, &dwfl, &bias); | 1526 | dbg = dwfl_init_live_kernel_dwarf(addr, &dwfl, &bias); |
1526 | if (!dbg) { | 1527 | if (!dbg) { |
1527 | pr_warning("No dwarf info found in the vmlinux - " | 1528 | pr_warning("No debug information found in the vmlinux - " |
1528 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); | 1529 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); |
1529 | ret = -EINVAL; | 1530 | ret = -EINVAL; |
1530 | goto end; | 1531 | goto end; |
@@ -1534,7 +1535,8 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt) | |||
1534 | addr += bias; | 1535 | addr += bias; |
1535 | /* Find cu die */ | 1536 | /* Find cu die */ |
1536 | if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr - bias, &cudie)) { | 1537 | if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr - bias, &cudie)) { |
1537 | pr_warning("No CU DIE is found at %lx\n", addr); | 1538 | pr_warning("Failed to find debug information for address %lx\n", |
1539 | addr); | ||
1538 | ret = -EINVAL; | 1540 | ret = -EINVAL; |
1539 | goto end; | 1541 | goto end; |
1540 | } | 1542 | } |
@@ -1659,7 +1661,7 @@ static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf) | |||
1659 | 1661 | ||
1660 | line_list__init(&lf->lr->line_list); | 1662 | line_list__init(&lf->lr->line_list); |
1661 | if (dwarf_getsrclines(&lf->cu_die, &lines, &nlines) != 0) { | 1663 | if (dwarf_getsrclines(&lf->cu_die, &lines, &nlines) != 0) { |
1662 | pr_warning("No source lines found in this CU.\n"); | 1664 | pr_warning("No source lines found.\n"); |
1663 | return -ENOENT; | 1665 | return -ENOENT; |
1664 | } | 1666 | } |
1665 | 1667 | ||
@@ -1784,7 +1786,7 @@ int find_line_range(int fd, struct line_range *lr) | |||
1784 | 1786 | ||
1785 | dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); | 1787 | dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); |
1786 | if (!dbg) { | 1788 | if (!dbg) { |
1787 | pr_warning("No dwarf info found in the vmlinux - " | 1789 | pr_warning("No debug information found in the vmlinux - " |
1788 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); | 1790 | "please rebuild with CONFIG_DEBUG_INFO=y.\n"); |
1789 | return -EBADF; | 1791 | return -EBADF; |
1790 | } | 1792 | } |