Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp2098148imm; Wed, 16 May 2018 07:52:53 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpS20FoyoV+5U7fc+PB+dyaZfk5Yc8QwV9JrYYls1MDKxZOA9OKcKdBv1K+z8H5X9vqT2u7 X-Received: by 2002:a17:902:1025:: with SMTP id b34-v6mr1241610pla.207.1526482373607; Wed, 16 May 2018 07:52:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526482373; cv=none; d=google.com; s=arc-20160816; b=NMUFNH948IZn0ue6OGJibvBjxE1BRBjeZw9hgoHWeZ2ExwDC1EcZScKaymTWmP05lo DrvhqG+ZuqPWX8/kHmL7mi1mop0xZMZ6DeTG+NUeeWxKeo42Recl8+vl/fyxn6emqGFx MNoeZkzffytjH3aaAWkRuqR2vTfWrJZ1gXFJwf/ctXJZrMrhTHZv3Lxw03V6F5IMQsdc 0BAuiGRciyGvKq7czi/RJkSBaG+Rb1ht5QtAP7MjSPG+HTayHQF9zuo0G2drqwZgdzY0 sZfEEjXI3QagolpVjjTHNbLGxvpROyJLHa7O+rCHcvq9PrWMmje/rxPQiIYd/IFqSd78 FEww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=GrFF1x2aEJhasgK7ZJAOQG8pwdGJ0UxU0d00qiG/2BM=; b=O8C2sgqBuBe8g9z9Un9wL4ATUpjCkEsB/D+PfLjJ2sEMLAlDzHaBtorn8lAsfY+Klr 6zss3NOdQmOgE9r+/UvFuE+6/xwACXkQvA9FPvlM02ZNqoSdgNFWseIqmcTouaKlOfr2 nOJHrgra53l3N9vt4z11zhsSvrsTikL3sJdD6ElQbSnrp7E8RYhiEipj2UqYjfUYdpq7 5R8hXb1ktolkUTGYzaHuolh8QBb9x+sEjVK4oP+6UJljsyqRSBltGcytUwnuDvWrzhjb vkpQcdHZbH1zvdKuIrA0zBqQ1nQ7833ViaTSYzXzVFrJgUKn0H2PePSerD8pJYkVQ7eP epDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VxLM8FxQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 69-v6si2850185pfv.135.2018.05.16.07.52.39; Wed, 16 May 2018 07:52:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=VxLM8FxQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752066AbeEPOtr (ORCPT + 99 others); Wed, 16 May 2018 10:49:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46120 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751132AbeEPOto (ORCPT ); Wed, 16 May 2018 10:49:44 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F5812083F; Wed, 16 May 2018 14:49:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1526482183; bh=Tj1yjqmiKOlccq14WYOBp0TK+K3/FwFf8rxhpCpY1Xw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VxLM8FxQcFYtzAjk8Yl9Io9I3fSuKuEA61V28FXIvSrbhL8NBej6BoGdDbRwTz5iQ ctqnmuVrUAZvBU/yJaT2nVcIYtQY8UMFLaTTVeiRoVytTPM8NfwJ5R88s7EbYIqoIt T5BwwHdr6aIby2xw/Jhq04GxhMBhUcPv7K7ybqvc= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 07/11] perf bpf: Add license(NAME) helper Date: Wed, 16 May 2018 11:49:04 -0300 Message-Id: <20180516144908.22212-8-acme@kernel.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180516144908.22212-1-acme@kernel.org> References: <20180516144908.22212-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo To further reduce boilerplate. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-vst6hj335s0ebxzqltes3nsc@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/examples/bpf/5sec.c | 3 +-- tools/perf/examples/bpf/empty.c | 3 +-- tools/perf/include/bpf/bpf.h | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/tools/perf/examples/bpf/5sec.c b/tools/perf/examples/bpf/5sec.c index 3d1ed34aec8b..6fc3697ac749 100644 --- a/tools/perf/examples/bpf/5sec.c +++ b/tools/perf/examples/bpf/5sec.c @@ -40,5 +40,4 @@ int func(void *ctx, int err, long sec) return sec == 5; } -char _license[] SEC("license") = "GPL"; -int _version SEC("version") = LINUX_VERSION_CODE; +license(GPL); diff --git a/tools/perf/examples/bpf/empty.c b/tools/perf/examples/bpf/empty.c index 86f97763355d..3776d26db9e7 100644 --- a/tools/perf/examples/bpf/empty.c +++ b/tools/perf/examples/bpf/empty.c @@ -1,4 +1,3 @@ #include -char _license[] SEC("license") = "GPL"; -int _version SEC("version") = LINUX_VERSION_CODE; +license(GPL); diff --git a/tools/perf/include/bpf/bpf.h b/tools/perf/include/bpf/bpf.h index 003afcab4e51..cdfd18b9c318 100644 --- a/tools/perf/include/bpf/bpf.h +++ b/tools/perf/include/bpf/bpf.h @@ -2,4 +2,9 @@ #ifndef _PERF_BPF_H #define _PERF_BPF_H #define SEC(NAME) __attribute__((section(NAME), used)) + +#define license(name) \ +char _license[] SEC("license") = #name; \ +int _version SEC("version") = LINUX_VERSION_CODE; + #endif /* _PERF_BPF_H */ -- 2.14.3