lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 11 Mar 2019 18:04:39 +0000
From:   Song Liu <songliubraving@...com>
To:     Jiri Olsa <jolsa@...hat.com>
CC:     "bpf@...r.kernel.org" <bpf@...r.kernel.org>,
        Networking <netdev@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        "ast@...nel.org" <ast@...nel.org>,
        "daniel@...earbox.net" <daniel@...earbox.net>,
        Kernel Team <Kernel-team@...com>,
        "peterz@...radead.org" <peterz@...radead.org>,
        "acme@...hat.com" <acme@...hat.com>,
        "jolsa@...nel.org" <jolsa@...nel.org>,
        "namhyung@...nel.org" <namhyung@...nel.org>
Subject: Re: [PATCH v7 perf,bpf 12/15] perf, bpf: enable annotation of bpf
 program



> On Mar 11, 2019, at 10:56 AM, Jiri Olsa <jolsa@...hat.com> wrote:
> 
> On Thu, Mar 07, 2019 at 09:58:07AM -0800, Song Liu wrote:
> 
> SNIP
> 
>> +		if (linfo && btf) {
>> +			srcline = btf__name_by_offset(btf, linfo->line_off);
>> +			nr_skip++;
>> +		} else
>> +			srcline = NULL;
>> +
>> +		fprintf(s, "\n");
>> +		prev_buf_size = buf_size;
>> +		fflush(s);
>> +
>> +		if (!opts->hide_src_code && srcline) {
>> +			args->offset = -1;
>> +			args->line = strdup(srcline);
>> +			args->line_nr = 0;
>> +			args->ms.sym  = sym;
>> +			dl = disasm_line__new(args);
>> +			if (dl) {
>> +				annotation_line__add(&dl->al,
>> +						     &notes->src->source);
>> +			}
>> +		}
> 
> I still miss answer for why is the line added twice for
> !opts->hide_src_code && srcline ? code up and down
> 
> jirka

The line above (under "!hide_src_code && srcline") is the src code 
line; while the one below is the disassemble output. We only show the 
source code when "!hide_src_code && srcline" is true. 

Thanks,
Song

>> +
>> +		args->offset = pc;
>> +		args->line = buf + prev_buf_size;
>> +		args->line_nr = 0;
>> +		args->ms.sym  = sym;
>> +		dl = disasm_line__new(args);
>> +		if (dl)
>> +			annotation_line__add(&dl->al, &notes->src->source);
>> +
>> +		pc += count;
>> +	} while (count > 0 && pc < len);
> 
> SNIP

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ