{
struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
u64 n = 0;
+ int ret;
/*
* if jit marker, then inject jit mmaps and generate ELF images
*/
- if (!jit_process(inject->session, &inject->output, machine,
- event->mmap.filename, sample->pid, &n)) {
+ ret = jit_process(inject->session, &inject->output, machine,
+ event->mmap.filename, sample->pid, &n);
+ if (ret < 0)
+ return ret;
+ if (ret) {
inject->bytes_written += n;
return 0;
}
{
struct perf_inject *inject = container_of(tool, struct perf_inject, tool);
u64 n = 0;
+ int ret;
/*
* if jit marker, then inject jit mmaps and generate ELF images
*/
- if (!jit_process(inject->session, &inject->output, machine,
- event->mmap2.filename, sample->pid, &n)) {
+ ret = jit_process(inject->session, &inject->output, machine,
+ event->mmap2.filename, sample->pid, &n);
+ if (ret < 0)
+ return ret;
+ if (ret) {
inject->bytes_written += n;
return 0;
}
* first, detect marker mmap (i.e., the jitdump mmap)
*/
if (jit_detect(filename, pid))
- return -1;
+ return 0;
memset(&jd, 0, sizeof(jd));
*nbytes = 0;
ret = jit_inject(&jd, filename);
- if (!ret)
+ if (!ret) {
*nbytes = jd.bytes_written;
+ ret = 1;
+ }
return ret;
}