Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332781 > unrolled thread

Re: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately

Started byJiri Olsa <jolsa@redhat.com>
First post2016-02-12 15:30 +0100
Last post2016-02-12 15:40 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH 14/54] perf tools: Support setting different slots in a  BPF map separately Jiri Olsa <jolsa@redhat.com> - 2016-02-12 15:30 +0100
    Re: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately pi3orama <pi3orama@163.com> - 2016-02-12 15:40 +0100

#1332781 — Re: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately

FromJiri Olsa <jolsa@redhat.com>
Date2016-02-12 15:30 +0100
SubjectRe: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately
Message-ID<r1mTo-8b8-11@gated-at.bofh.it>
On Fri, Feb 05, 2016 at 02:01:39PM +0000, Wang Nan wrote:

SNIP

>  
> +int parse_events__merge_arrays(struct parse_events_array *dest,
> +			       struct parse_events_array *another)
> +{
> +	struct parse_events_array new;
> +
> +	if (!dest || !another)
> +		return -EINVAL;
> +
> +	new.nr_ranges = dest->nr_ranges + another->nr_ranges;
> +	new.ranges = malloc(sizeof(new.ranges[0]) * new.nr_ranges);
> +	if (!new.ranges)
> +		return -ENOMEM;
> +
> +	memcpy(&new.ranges[0], dest->ranges,
> +	       sizeof(new.ranges[0]) * dest->nr_ranges);
> +	memcpy(&new.ranges[dest->nr_ranges], another->ranges,
> +	       sizeof(new.ranges[0]) * another->nr_ranges);
> +	free(dest->ranges);
> +	free(another->ranges);
> +	*dest = new;
> +	return 0;
> +}

is there a user for this function in this patchset? can't find it..

I recall I've already seen it in earlier versions, but can't find it now ;-)

jirka

[toc] | [next] | [standalone]


#1332785 — Re: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately

Frompi3orama <pi3orama@163.com>
Date2016-02-12 15:40 +0100
SubjectRe: [PATCH 14/54] perf tools: Support setting different slots in a BPF map separately
Message-ID<r1n34-8em-15@gated-at.bofh.it>
In reply to#1332781

发自我的 iPhone

> 在 2016年2月12日,下午10:23,Jiri Olsa <jolsa@redhat.com> 写道:
> 
> On Fri, Feb 05, 2016 at 02:01:39PM +0000, Wang Nan wrote:
> 
> SNIP
> 
>> 
>> +int parse_events__merge_arrays(struct parse_events_array *dest,
>> +                   struct parse_events_array *another)
>> +{
>> +    struct parse_events_array new;
>> +
>> +    if (!dest || !another)
>> +        return -EINVAL;
>> +
>> +    new.nr_ranges = dest->nr_ranges + another->nr_ranges;
>> +    new.ranges = malloc(sizeof(new.ranges[0]) * new.nr_ranges);
>> +    if (!new.ranges)
>> +        return -ENOMEM;
>> +
>> +    memcpy(&new.ranges[0], dest->ranges,
>> +           sizeof(new.ranges[0]) * dest->nr_ranges);
>> +    memcpy(&new.ranges[dest->nr_ranges], another->ranges,
>> +           sizeof(new.ranges[0]) * another->nr_ranges);
>> +    free(dest->ranges);
>> +    free(another->ranges);
>> +    *dest = new;
>> +    return 0;
>> +}
> 
> is there a user for this function in this patchset? can't find it..
> 
> I recall I've already seen it in earlier versions, but can't find it now ;-)
> 

Sorry, I should remove this function. It
is designed to be used in patch 15, but
I found it require more code if use this
function, so instead patch 15 does the
merging inline, makes this function useless.

Thank you.

> jirka

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web