[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0F68F234-7913-4869-B56B-59A1AF06BB8C@fb.com>
Date: Tue, 19 Feb 2019 05:48:00 +0000
From: Song Liu <songliubraving@...com>
To: Jiri Olsa <jolsa@...hat.com>
CC: Netdev <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 v3 perf,bpf 08/11] perf, bpf: save btf information as
headers to perf.data
> On Feb 17, 2019, at 3:06 PM, Jiri Olsa <jolsa@...hat.com> wrote:
>
> On Fri, Feb 15, 2019 at 01:53:51PM -0800, Song Liu wrote:
>
> SNIP
>
>> +static int process_btf(struct feat_fd *ff, void *data __maybe_unused)
>> +{
>> + struct perf_env *env = &ff->ph->env;
>> + u32 count, i;
>> +
>> + if (do_read_u32(ff, &count))
>> + return -1;
>> +
>> + down_write(&env->bpf_progs.bpf_info_lock);
>> +
>> + for (i = 0; i < count; ++i) {
>> + struct btf_node btf_node;
>> + struct btf_node *node;
>> +
>> + if (__do_read(ff, &btf_node, sizeof(struct btf_node)))
>> + return -1;
>> +
>> + node = malloc(sizeof(struct btf_node) + btf_node.data_size);
>> + if (!node)
>> + return -1;
>> +
>> + node->id = btf_node.id;
>> + node->data_size = btf_node.data_size;
>> +
>> + if (__do_read(ff, node->data, btf_node.data_size)) {
>> + free(node);
>> + return -1;
>> + }
>
> hows endianity swap handled got struct btf_node and data in here?
>
> thanks,
> jirka
I thought about endianity at some point, but forgot about it. Let
me see how to fix it.
Thanks,
Song
Powered by blists - more mailing lists