summaryrefslogtreecommitdiffstats
path: root/tools/perf/jvmti/jvmti_agent.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman2018-01-02 15:13:41 +0100
committerGreg Kroah-Hartman2018-01-02 15:13:41 +0100
commit01f1918833e4817fdb0810306c021c5cbee775d3 (patch)
tree34a649c453d30fee1f1b564badb6e3dc210655c3 /tools/perf/jvmti/jvmti_agent.c
parentusb: pd: fix the offset for SVID specific commands (diff)
parentLinux 4.15-rc6 (diff)
downloadkernel-qcow2-linux-01f1918833e4817fdb0810306c021c5cbee775d3.tar.gz
kernel-qcow2-linux-01f1918833e4817fdb0810306c021c5cbee775d3.tar.xz
kernel-qcow2-linux-01f1918833e4817fdb0810306c021c5cbee775d3.zip
Merge 4.15.0-rc6 into usb-next
We want the USB fixes in here, and this resolves a merge issue with the vhci_rx.c file. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/perf/jvmti/jvmti_agent.c')
-rw-r--r--tools/perf/jvmti/jvmti_agent.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/tools/perf/jvmti/jvmti_agent.c b/tools/perf/jvmti/jvmti_agent.c
index cf36de7ea255..0c6d1002b524 100644
--- a/tools/perf/jvmti/jvmti_agent.c
+++ b/tools/perf/jvmti/jvmti_agent.c
@@ -384,13 +384,13 @@ jvmti_write_code(void *agent, char const *sym,
}
int
-jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
- jvmti_line_info_t *li, int nr_lines)
+jvmti_write_debug_info(void *agent, uint64_t code,
+ int nr_lines, jvmti_line_info_t *li,
+ const char * const * file_names)
{
struct jr_code_debug_info rec;
- size_t sret, len, size, flen;
+ size_t sret, len, size, flen = 0;
uint64_t addr;
- const char *fn = file;
FILE *fp = agent;
int i;
@@ -405,7 +405,9 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
return -1;
}
- flen = strlen(file) + 1;
+ for (i = 0; i < nr_lines; ++i) {
+ flen += strlen(file_names[i]) + 1;
+ }
rec.p.id = JIT_CODE_DEBUG_INFO;
size = sizeof(rec);
@@ -421,7 +423,7 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
* file[] : source file name
*/
size += nr_lines * sizeof(struct debug_entry);
- size += flen * nr_lines;
+ size += flen;
rec.p.total_size = size;
/*
@@ -452,7 +454,7 @@ jvmti_write_debug_info(void *agent, uint64_t code, const char *file,
if (sret != 1)
goto error;
- sret = fwrite_unlocked(fn, flen, 1, fp);
+ sret = fwrite_unlocked(file_names[i], strlen(file_names[i]) + 1, 1, fp);
if (sret != 1)
goto error;
}