Commit 0e43e5d2 authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Arnaldo Carvalho de Melo

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: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent ec5761ea
...@@ -95,7 +95,7 @@ static int init_vmlinux(void) ...@@ -95,7 +95,7 @@ static int init_vmlinux(void)
goto out; goto out;
if (machine__create_kernel_maps(&machine) < 0) { if (machine__create_kernel_maps(&machine) < 0) {
pr_debug("machine__create_kernel_maps "); pr_debug("machine__create_kernel_maps() failed.\n");
goto out; goto out;
} }
out: out:
...@@ -140,7 +140,8 @@ static int open_vmlinux(const char *module) ...@@ -140,7 +140,8 @@ static int open_vmlinux(const char *module)
{ {
const char *path = kernel_get_module_path(module); const char *path = kernel_get_module_path(module);
if (!path) { if (!path) {
pr_err("Failed to find path of %s module", module ?: "kernel"); pr_err("Failed to find path of %s module.\n",
module ?: "kernel");
return -ENOENT; return -ENOENT;
} }
pr_debug("Try to open %s\n", path); pr_debug("Try to open %s\n", path);
...@@ -217,7 +218,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev, ...@@ -217,7 +218,7 @@ static int try_to_find_probe_trace_events(struct perf_probe_event *pev,
pr_warning("Warning: No dwarf info found in the vmlinux - " pr_warning("Warning: No dwarf info found in the vmlinux - "
"please rebuild kernel with CONFIG_DEBUG_INFO=y.\n"); "please rebuild kernel with CONFIG_DEBUG_INFO=y.\n");
if (!need_dwarf) { if (!need_dwarf) {
pr_debug("Trying to use symbols.\nn"); pr_debug("Trying to use symbols.\n");
return 0; return 0;
} }
} }
...@@ -457,7 +458,7 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs, ...@@ -457,7 +458,7 @@ int show_available_vars(struct perf_probe_event *pevs, int npevs,
fd = open_vmlinux(module); fd = open_vmlinux(module);
if (fd < 0) { if (fd < 0) {
pr_warning("Failed to open debuginfo file.\n"); pr_warning("Failed to open debug information file.\n");
return fd; return fd;
} }
...@@ -690,39 +691,40 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev) ...@@ -690,39 +691,40 @@ static int parse_perf_probe_point(char *arg, struct perf_probe_event *pev)
/* Exclusion check */ /* Exclusion check */
if (pp->lazy_line && pp->line) { if (pp->lazy_line && pp->line) {
semantic_error("Lazy pattern can't be used with line number."); semantic_error("Lazy pattern can't be used with"
" line number.\n");
return -EINVAL; return -EINVAL;
} }
if (pp->lazy_line && pp->offset) { if (pp->lazy_line && pp->offset) {
semantic_error("Lazy pattern can't be used with offset."); semantic_error("Lazy pattern can't be used with offset.\n");
return -EINVAL; return -EINVAL;
} }
if (pp->line && pp->offset) { if (pp->line && pp->offset) {
semantic_error("Offset can't be used with line number."); semantic_error("Offset can't be used with line number.\n");
return -EINVAL; return -EINVAL;
} }
if (!pp->line && !pp->lazy_line && pp->file && !pp->function) { if (!pp->line && !pp->lazy_line && pp->file && !pp->function) {
semantic_error("File always requires line number or " semantic_error("File always requires line number or "
"lazy pattern."); "lazy pattern.\n");
return -EINVAL; return -EINVAL;
} }
if (pp->offset && !pp->function) { if (pp->offset && !pp->function) {
semantic_error("Offset requires an entry function."); semantic_error("Offset requires an entry function.\n");
return -EINVAL; return -EINVAL;
} }
if (pp->retprobe && !pp->function) { if (pp->retprobe && !pp->function) {
semantic_error("Return probe requires an entry function."); semantic_error("Return probe requires an entry function.\n");
return -EINVAL; return -EINVAL;
} }
if ((pp->offset || pp->line || pp->lazy_line) && pp->retprobe) { if ((pp->offset || pp->line || pp->lazy_line) && pp->retprobe) {
semantic_error("Offset/Line/Lazy pattern can't be used with " semantic_error("Offset/Line/Lazy pattern can't be used with "
"return probe."); "return probe.\n");
return -EINVAL; return -EINVAL;
} }
...@@ -996,7 +998,7 @@ int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf, size_t len) ...@@ -996,7 +998,7 @@ int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf, size_t len)
return tmp - buf; return tmp - buf;
error: error:
pr_debug("Failed to synthesize perf probe argument: %s", pr_debug("Failed to synthesize perf probe argument: %s\n",
strerror(-ret)); strerror(-ret));
return ret; return ret;
} }
...@@ -1046,7 +1048,7 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp) ...@@ -1046,7 +1048,7 @@ static char *synthesize_perf_probe_point(struct perf_probe_point *pp)
return buf; return buf;
error: error:
pr_debug("Failed to synthesize perf probe point: %s", pr_debug("Failed to synthesize perf probe point: %s\n",
strerror(-ret)); strerror(-ret));
if (buf) if (buf)
free(buf); free(buf);
...@@ -1787,7 +1789,7 @@ static int del_trace_probe_event(int fd, const char *group, ...@@ -1787,7 +1789,7 @@ static int del_trace_probe_event(int fd, const char *group,
ret = e_snprintf(buf, 128, "%s:%s", group, event); ret = e_snprintf(buf, 128, "%s:%s", group, event);
if (ret < 0) { if (ret < 0) {
pr_err("Failed to copy event."); pr_err("Failed to copy event.\n");
return ret; return ret;
} }
......
...@@ -627,8 +627,8 @@ static int convert_variable_location(Dwarf_Die *vr_die, Dwarf_Addr addr, ...@@ -627,8 +627,8 @@ static int convert_variable_location(Dwarf_Die *vr_die, Dwarf_Addr addr,
regs = get_arch_regstr(regn); regs = get_arch_regstr(regn);
if (!regs) { if (!regs) {
/* This should be a bug in DWARF or this tool */ /* This should be a bug in DWARF or this tool */
pr_warning("Mapping for DWARF register number %u " pr_warning("Mapping for the register number %u "
"missing on this architecture.", regn); "missing on this architecture.\n", regn);
return -ERANGE; return -ERANGE;
} }
...@@ -674,13 +674,14 @@ static int convert_variable_type(Dwarf_Die *vr_die, ...@@ -674,13 +674,14 @@ static int convert_variable_type(Dwarf_Die *vr_die,
if (ret != DW_TAG_pointer_type && if (ret != DW_TAG_pointer_type &&
ret != DW_TAG_array_type) { ret != DW_TAG_array_type) {
pr_warning("Failed to cast into string: " pr_warning("Failed to cast into string: "
"%s(%s) is not a pointer nor array.", "%s(%s) is not a pointer nor array.\n",
dwarf_diename(vr_die), dwarf_diename(&type)); dwarf_diename(vr_die), dwarf_diename(&type));
return -EINVAL; return -EINVAL;
} }
if (ret == DW_TAG_pointer_type) { if (ret == DW_TAG_pointer_type) {
if (die_get_real_type(&type, &type) == NULL) { if (die_get_real_type(&type, &type) == NULL) {
pr_warning("Failed to get a type information."); pr_warning("Failed to get a type"
" information.\n");
return -ENOENT; return -ENOENT;
} }
while (*ref_ptr) while (*ref_ptr)
...@@ -695,7 +696,7 @@ static int convert_variable_type(Dwarf_Die *vr_die, ...@@ -695,7 +696,7 @@ static int convert_variable_type(Dwarf_Die *vr_die,
if (!die_compare_name(&type, "char") && if (!die_compare_name(&type, "char") &&
!die_compare_name(&type, "unsigned char")) { !die_compare_name(&type, "unsigned char")) {
pr_warning("Failed to cast into string: " pr_warning("Failed to cast into string: "
"%s is not (unsigned) char *.", "%s is not (unsigned) char *.\n",
dwarf_diename(vr_die)); dwarf_diename(vr_die));
return -EINVAL; return -EINVAL;
} }
...@@ -805,8 +806,8 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname, ...@@ -805,8 +806,8 @@ static int convert_variable_fields(Dwarf_Die *vr_die, const char *varname,
return -EINVAL; return -EINVAL;
} }
if (field->name[0] == '[') { if (field->name[0] == '[') {
pr_err("Semantic error: %s is not a pointor nor array.", pr_err("Semantic error: %s is not a pointor"
varname); " nor array.\n", varname);
return -EINVAL; return -EINVAL;
} }
if (field->ref) { if (field->ref) {
...@@ -953,7 +954,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, ...@@ -953,7 +954,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
name = dwarf_diename(sp_die); name = dwarf_diename(sp_die);
if (name) { if (name) {
if (dwarf_entrypc(sp_die, &eaddr) != 0) { if (dwarf_entrypc(sp_die, &eaddr) != 0) {
pr_warning("Failed to get entry pc of %s\n", pr_warning("Failed to get entry address of %s\n",
dwarf_diename(sp_die)); dwarf_diename(sp_die));
return -ENOENT; return -ENOENT;
} }
...@@ -969,7 +970,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr, ...@@ -969,7 +970,7 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwarf_Addr paddr,
if (retprobe) { if (retprobe) {
if (eaddr != paddr) { if (eaddr != paddr) {
pr_warning("Return probe must be on the head of" pr_warning("Return probe must be on the head of"
" a real function\n"); " a real function.\n");
return -EINVAL; return -EINVAL;
} }
tp->retprobe = true; tp->retprobe = true;
...@@ -1008,7 +1009,7 @@ static int call_probe_finder(Dwarf_Die *sp_die, struct probe_finder *pf) ...@@ -1008,7 +1009,7 @@ static int call_probe_finder(Dwarf_Die *sp_die, struct probe_finder *pf)
Dwarf_Frame *frame; Dwarf_Frame *frame;
if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 || if (dwarf_cfi_addrframe(pf->cfi, pf->addr, &frame) != 0 ||
dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) { dwarf_frame_cfa(frame, &pf->fb_ops, &nops) != 0) {
pr_warning("Failed to get CFA on 0x%jx\n", pr_warning("Failed to get call frame on 0x%jx\n",
(uintmax_t)pf->addr); (uintmax_t)pf->addr);
return -ENOENT; return -ENOENT;
} }
...@@ -1035,7 +1036,7 @@ static int find_probe_point_by_line(struct probe_finder *pf) ...@@ -1035,7 +1036,7 @@ static int find_probe_point_by_line(struct probe_finder *pf)
int ret = 0; int ret = 0;
if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) {
pr_warning("No source lines found in this CU.\n"); pr_warning("No source lines found.\n");
return -ENOENT; return -ENOENT;
} }
...@@ -1137,7 +1138,7 @@ static int find_probe_point_lazy(Dwarf_Die *sp_die, struct probe_finder *pf) ...@@ -1137,7 +1138,7 @@ static int find_probe_point_lazy(Dwarf_Die *sp_die, struct probe_finder *pf)
} }
if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) { if (dwarf_getsrclines(&pf->cu_die, &lines, &nlines) != 0) {
pr_warning("No source lines found in this CU.\n"); pr_warning("No source lines found.\n");
return -ENOENT; return -ENOENT;
} }
...@@ -1195,7 +1196,7 @@ static int probe_point_inline_cb(Dwarf_Die *in_die, void *data) ...@@ -1195,7 +1196,7 @@ static int probe_point_inline_cb(Dwarf_Die *in_die, void *data)
else { else {
/* Get probe address */ /* Get probe address */
if (dwarf_entrypc(in_die, &addr) != 0) { if (dwarf_entrypc(in_die, &addr) != 0) {
pr_warning("Failed to get entry pc of %s.\n", pr_warning("Failed to get entry address of %s.\n",
dwarf_diename(in_die)); dwarf_diename(in_die));
param->retval = -ENOENT; param->retval = -ENOENT;
return DWARF_CB_ABORT; return DWARF_CB_ABORT;
...@@ -1236,8 +1237,8 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data) ...@@ -1236,8 +1237,8 @@ static int probe_point_search_cb(Dwarf_Die *sp_die, void *data)
param->retval = find_probe_point_lazy(sp_die, pf); param->retval = find_probe_point_lazy(sp_die, pf);
else { else {
if (dwarf_entrypc(sp_die, &pf->addr) != 0) { if (dwarf_entrypc(sp_die, &pf->addr) != 0) {
pr_warning("Failed to get entry pc of %s.\n", pr_warning("Failed to get entry address of "
dwarf_diename(sp_die)); "%s.\n", dwarf_diename(sp_die));
param->retval = -ENOENT; param->retval = -ENOENT;
return DWARF_CB_ABORT; return DWARF_CB_ABORT;
} }
...@@ -1279,7 +1280,7 @@ static int find_probes(int fd, struct probe_finder *pf) ...@@ -1279,7 +1280,7 @@ static int find_probes(int fd, struct probe_finder *pf)
dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias);
if (!dbg) { if (!dbg) {
pr_warning("No dwarf info found in the vmlinux - " pr_warning("No debug information found in the vmlinux - "
"please rebuild with CONFIG_DEBUG_INFO=y.\n"); "please rebuild with CONFIG_DEBUG_INFO=y.\n");
return -EBADF; return -EBADF;
} }
...@@ -1524,7 +1525,7 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt) ...@@ -1524,7 +1525,7 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt)
/* Open the live linux kernel */ /* Open the live linux kernel */
dbg = dwfl_init_live_kernel_dwarf(addr, &dwfl, &bias); dbg = dwfl_init_live_kernel_dwarf(addr, &dwfl, &bias);
if (!dbg) { if (!dbg) {
pr_warning("No dwarf info found in the vmlinux - " pr_warning("No debug information found in the vmlinux - "
"please rebuild with CONFIG_DEBUG_INFO=y.\n"); "please rebuild with CONFIG_DEBUG_INFO=y.\n");
ret = -EINVAL; ret = -EINVAL;
goto end; goto end;
...@@ -1534,7 +1535,8 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt) ...@@ -1534,7 +1535,8 @@ int find_perf_probe_point(unsigned long addr, struct perf_probe_point *ppt)
addr += bias; addr += bias;
/* Find cu die */ /* Find cu die */
if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr - bias, &cudie)) { if (!dwarf_addrdie(dbg, (Dwarf_Addr)addr - bias, &cudie)) {
pr_warning("No CU DIE is found at %lx\n", addr); pr_warning("Failed to find debug information for address %lx\n",
addr);
ret = -EINVAL; ret = -EINVAL;
goto end; goto end;
} }
...@@ -1659,7 +1661,7 @@ static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf) ...@@ -1659,7 +1661,7 @@ static int find_line_range_by_line(Dwarf_Die *sp_die, struct line_finder *lf)
line_list__init(&lf->lr->line_list); line_list__init(&lf->lr->line_list);
if (dwarf_getsrclines(&lf->cu_die, &lines, &nlines) != 0) { if (dwarf_getsrclines(&lf->cu_die, &lines, &nlines) != 0) {
pr_warning("No source lines found in this CU.\n"); pr_warning("No source lines found.\n");
return -ENOENT; return -ENOENT;
} }
...@@ -1784,7 +1786,7 @@ int find_line_range(int fd, struct line_range *lr) ...@@ -1784,7 +1786,7 @@ int find_line_range(int fd, struct line_range *lr)
dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias); dbg = dwfl_init_offline_dwarf(fd, &dwfl, &bias);
if (!dbg) { if (!dbg) {
pr_warning("No dwarf info found in the vmlinux - " pr_warning("No debug information found in the vmlinux - "
"please rebuild with CONFIG_DEBUG_INFO=y.\n"); "please rebuild with CONFIG_DEBUG_INFO=y.\n");
return -EBADF; return -EBADF;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment