aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/symbol.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
index 1adb143867e3..be84f7a9838b 100644
--- a/tools/perf/util/symbol.c
+++ b/tools/perf/util/symbol.c
@@ -1757,7 +1757,7 @@ static int vmlinux_path__init(struct perf_session_env *env)
1757 char bf[PATH_MAX]; 1757 char bf[PATH_MAX];
1758 char *kernel_version; 1758 char *kernel_version;
1759 1759
1760 vmlinux_path = malloc(sizeof(char *) * 5); 1760 vmlinux_path = malloc(sizeof(char *) * 6);
1761 if (vmlinux_path == NULL) 1761 if (vmlinux_path == NULL)
1762 return -1; 1762 return -1;
1763 1763
@@ -1788,6 +1788,12 @@ static int vmlinux_path__init(struct perf_session_env *env)
1788 if (vmlinux_path[vmlinux_path__nr_entries] == NULL) 1788 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1789 goto out_fail; 1789 goto out_fail;
1790 ++vmlinux_path__nr_entries; 1790 ++vmlinux_path__nr_entries;
1791 snprintf(bf, sizeof(bf), "/usr/lib/debug/boot/vmlinux-%s",
1792 kernel_version);
1793 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
1794 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)
1795 goto out_fail;
1796 ++vmlinux_path__nr_entries;
1791 snprintf(bf, sizeof(bf), "/lib/modules/%s/build/vmlinux", kernel_version); 1797 snprintf(bf, sizeof(bf), "/lib/modules/%s/build/vmlinux", kernel_version);
1792 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf); 1798 vmlinux_path[vmlinux_path__nr_entries] = strdup(bf);
1793 if (vmlinux_path[vmlinux_path__nr_entries] == NULL) 1799 if (vmlinux_path[vmlinux_path__nr_entries] == NULL)