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


Groups > linux.kernel > #1273805

Re: [RFC PATCH 1/7] perf tools: Add API to config maps in bpf object

From "Wangnan (F)" <wangnan0@huawei.com>
Newsgroups linux.kernel
Subject Re: [RFC PATCH 1/7] perf tools: Add API to config maps in bpf object
Date 2015-11-20 09:20 +0100
Message-ID <qwP5g-4EO-37@gated-at.bofh.it> (permalink)
References <qkxdM-3h1-15@gated-at.bofh.it> <qkxnr-3sd-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 2015/10/17 18:48, Wang Nan wrote:
> bpf__config_obj() is introduced as a core API to config BPF object
> after loading. One configuration option of maps is introduced. After
> this patch BPF object can accept configuration like:
>
>   maps.my_map.value=1234

There's an inconvience in this syntax.

In following cmdline:

  # perf record -e mybpf.c/maps.channel.value=1234/ ls

because of the greedy manner of flex, mybpf.c/maps.c would
be expressed as path of a BPF source file (and yes, it is a valid
path).

If flex has a non-greedy mode then it would be fixed easily. However,
the official flex docs reveals its policy that it doesn't and would not
provide non-greedy matching. Even if we have non-greedy matching,
we are unable to prohibit user to put their BPF object into path
like

/home/user/mybpf.c/thefile.c

Fortunately this patch has not beed merged, so we have a chance to fix
it at very beginning. I will replace all '.' in object config string
to ':', so the above cmdline becomes:

  # perf record -e mybpf.c/maps:channel:value=1234/ ls

[1] 
http://flex.sourceforge.net/manual/Why-doesn_0027t-flex-have-non_002dgreedy-operators-like-perl-does_003f.html


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [RFC PATCH 1/7] perf tools: Add API to config maps in bpf object "Wangnan (F)" <wangnan0@huawei.com> - 2015-11-20 09:20 +0100

csiph-web