Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758855AbbEFELH (ORCPT ); Wed, 6 May 2015 00:11:07 -0400 Received: from mail-ig0-f181.google.com ([209.85.213.181]:33106 "EHLO mail-ig0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758820AbbEFELD (ORCPT ); Wed, 6 May 2015 00:11:03 -0400 Message-ID: <55499453.7070509@plumgrid.com> Date: Tue, 05 May 2015 21:10:59 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Wang Nan , He Kuang , davem@davemloft.net, acme@kernel.org, mingo@redhat.com, a.p.zijlstra@chello.nl, masami.hiramatsu.pt@hitachi.com, jolsa@kernel.org CC: linux-kernel@vger.kernel.org, pi3orama@163.com Subject: Re: [RFC PATCH 0/6] perf bpf: Probing with local variable References: <1430820612-84443-1-git-send-email-hekuang@huawei.com> <554944C1.3060705@plumgrid.com> <5549914F.9070808@huawei.com> In-Reply-To: <5549914F.9070808@huawei.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1555 Lines: 34 On 5/5/15 8:58 PM, Wang Nan wrote: >> Two high level comments: >> - can you collapse SEC("config") with SEC("func_name") ? >> It seems that "func_name" is only used as reference inside "config". >> I understand that you're proposing one "config" section where multiple >> descriptions are strcat together, but why? Something like: >> SEC("kprobe/generic_perform_write+122(file->f_mapping->a_ops, bytes, offset)") >> int func(...) { ... } >> should be enough and more concise. >> > > Is it possible to use such a long section name? I introduce 'config' section yes. of course. I don't know what is the limit, but it's definitely above 512 characters. It can contains spaces and special chars too. > since it contains C strings so I can put things to it freely. By using macro trick, > we can still use not very complex code to describe probing position like this: > > #define PROBE(name, config) \ > SEC("config") char name##_config[] = #name config ; \ > SEC(#name) > PROBE(generic_perform_write, "kprobe: +122(file->f_mapping->a_ops, bytes, offset)") that's even more obscure :( why hide it behind macros? I think single 'SEC' macro is already not very clean, but I couldn't come up with better alternative. Elf sections are free that why I used them in samples/bpf/ examples, but let's not overuse them. -- 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/