Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 169551
b: refs/heads/master
c: a7f4328
h: refs/heads/master
i:
  169549: d467667
  169547: 98db3fd
  169543: ac32f63
  169535: 75af5f6
v: v3
  • Loading branch information
Masami Hiramatsu authored and Ingo Molnar committed Nov 4, 2009
1 parent bbb87f8 commit 02ff904
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c43f9d1e61e265c6bfafdd65c7f07c8d71a7efc3
refs/heads/master: a7f4328b91fb6e71dbe1fa4d46f3597c9555014d
20 changes: 13 additions & 7 deletions trunk/tools/perf/builtin-probe.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,10 +294,11 @@ static int write_new_event(int fd, const char *buf)
{
int ret;

printf("Adding new event: %s\n", buf);
ret = write(fd, buf, strlen(buf));
if (ret <= 0)
die("failed to create event.");
die("Failed to create event.");
else
printf("Added new event: %s\n", buf);

return ret;
}
Expand All @@ -310,7 +311,7 @@ static int synthesize_probe_event(struct probe_point *pp)
int i, len, ret;
pp->probes[0] = buf = (char *)calloc(MAX_CMDLEN, sizeof(char));
if (!buf)
die("calloc");
die("Failed to allocate memory by calloc.");
ret = snprintf(buf, MAX_CMDLEN, "%s+%d", pp->function, pp->offset);
if (ret <= 0 || ret >= MAX_CMDLEN)
goto error;
Expand Down Expand Up @@ -363,7 +364,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
if (ret == -E2BIG)
semantic_error("probe point is too long.");
else if (ret < 0)
die("snprintf");
die("Failed to synthesize a probe point.");
}

#ifndef NO_LIBDWARF
Expand All @@ -375,7 +376,7 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
else
fd = open_default_vmlinux();
if (fd < 0)
die("vmlinux/module file open");
die("Could not open vmlinux/module file.");

/* Searching probe points */
for (j = 0; j < session.nr_probe; j++) {
Expand All @@ -396,8 +397,13 @@ int cmd_probe(int argc, const char **argv, const char *prefix __used)
/* Settng up probe points */
snprintf(buf, MAX_CMDLEN, "%s/../kprobe_events", debugfs_path);
fd = open(buf, O_WRONLY, O_APPEND);
if (fd < 0)
die("kprobe_events open");
if (fd < 0) {
if (errno == ENOENT)
die("kprobe_events file does not exist - please rebuild with CONFIG_KPROBE_TRACER.");
else
die("Could not open kprobe_events file: %s",
strerror(errno));
}
for (j = 0; j < session.nr_probe; j++) {
pp = &session.probes[j];
if (pp->found == 1) {
Expand Down
2 changes: 1 addition & 1 deletion trunk/tools/perf/util/probe-finder.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ int find_probepoint(int fd, struct probe_point *pp)

ret = dwarf_init(fd, DW_DLC_READ, 0, 0, &__dw_debug, &__dw_error);
if (ret != DW_DLV_OK)
die("Failed to call dwarf_init(). Maybe, not a dwarf file.\n");
die("No dwarf info found in the vmlinux - please rebuild with CONFIG_DEBUG_INFO.\n");

pp->found = 0;
while (++cu_number) {
Expand Down

0 comments on commit 02ff904

Please sign in to comment.