Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5205473imb; Thu, 7 Mar 2019 10:01:25 -0800 (PST) X-Google-Smtp-Source: APXvYqytbvaFI2c1IpI4kePWhQVMjwoMV4YrdtyP3tyizKR+Q+3n6gPnYTFcD56QV0g1rlV1xjVM X-Received: by 2002:a63:790:: with SMTP id 138mr885371pgh.253.1551981684937; Thu, 07 Mar 2019 10:01:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551981684; cv=none; d=google.com; s=arc-20160816; b=qa5+kXd9XS2MQjxfALJt3Aklc7Ro2Bc0/IloRdf1RWH6FkGe8c6azyO9qPlAxLThce J23HCW8a8+IgcKTq8fo7DhxAgRje0uprKMtXVZlktNlqm+kok1An+mg3G2k3aeVd2R3s QrTk8MPPXaufIwaTG9bwlcnbbtu2RXODGRUefu5z1lA92dRCUW+xVJUw6l8u79v8pm3p dhHKI1rahCwrKCWiHmCo6hM3xltenFW+UArEVMaQ35ycHAaNBWjo6Y8DGdXIvokyl0C0 T2J8RBIuxsxDi0/KVpS5a8A7jwUCc5SDQUthprxIDZEpV9n+wNigdCMYan6kpiqqOJRo IYiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:smtp-origin-cluster:cc:to :smtp-origin-hostname:from:smtp-origin-hostprefix:dkim-signature; bh=YD+fcm/fusDClh4H7LLxV82JlUR6M6cXHEgXwK9hXPY=; b=MIqj5M90B/feRNBKBcjdWLbYYI4/JKPA4S3tUJGK/3GmxPSlZQp2am0Z0uFKG2rLQr S8d2egoGEOZ1joJ3rJC0D06racQnOV46Rf1WTt7rfBCb431jc026Nz6zqpYmYphbo2NW q76koX/rBR9TTWE5sDz8wkjUaiMfI4Glg93+chwVV2Xk00E0cw98yZJN+b9s9h4Wk91j SM/fDVIWzXK2h53Yc09GuBExNxhc1SgsmHREE/5jrL/MO75LrO5Vzgyb73mWtReri/Ep uwVYH2X1EYreDhcyVTbr6EFDfKkkHpkEysk3gt+FFCGRXk8y7yRa857Bq2/n7BzehdJJ svZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=DJwzwZJP; 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=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si4640692pll.376.2019.03.07.10.01.08; Thu, 07 Mar 2019 10:01:24 -0800 (PST) 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=@fb.com header.s=facebook header.b=DJwzwZJP; 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=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726616AbfCGR66 (ORCPT + 99 others); Thu, 7 Mar 2019 12:58:58 -0500 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:48494 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726393AbfCGR6e (ORCPT ); Thu, 7 Mar 2019 12:58:34 -0500 Received: from pps.filterd (m0044010.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x27HoOpE005354 for ; Thu, 7 Mar 2019 09:58:32 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=YD+fcm/fusDClh4H7LLxV82JlUR6M6cXHEgXwK9hXPY=; b=DJwzwZJPYxYB9xdLZdKEUnU/FErUWcDax8eKj9BGdwxkwJ+cSMdiukkb8NlP61ARbHUB J4jsXv3NsP0RoV9f580xp1Q0FlpuF3UA/MhVuDqNrgflj+Wq+YI4ikhMAFu1cIGoP8K/ 0TgfXLAWxHtiGAKCgE4eYsRKVxIaErm994Q= Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2r37hhr73j-11 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Thu, 07 Mar 2019 09:58:32 -0800 Received: from mx-out.facebook.com (2620:10d:c081:10::13) by mail.thefacebook.com (2620:10d:c081:35::125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA) id 15.1.1713.5; Thu, 7 Mar 2019 09:58:30 -0800 Received: by devbig006.ftw2.facebook.com (Postfix, from userid 4523) id CA24762E1750; Thu, 7 Mar 2019 09:58:29 -0800 (PST) Smtp-Origin-Hostprefix: devbig From: Song Liu Smtp-Origin-Hostname: devbig006.ftw2.facebook.com To: , , CC: , , , , , , , Song Liu Smtp-Origin-Cluster: ftw2c04 Subject: [PATCH v7 perf,bpf 05/15] perf: change prototype of perf_event__synthesize_bpf_events() Date: Thu, 7 Mar 2019 09:58:00 -0800 Message-ID: <20190307175810.249857-6-songliubraving@fb.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190307175810.249857-1-songliubraving@fb.com> References: <20190307175810.249857-1-songliubraving@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-03-07_09:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch changes the arguments of perf_event__synthesize_bpf_events() to include perf_session* instead of perf_tool*. perf_session will be used in the next patch. Signed-off-by: Song Liu --- tools/perf/builtin-record.c | 2 +- tools/perf/builtin-top.c | 2 +- tools/perf/util/bpf-event.c | 8 +++++--- tools/perf/util/bpf-event.h | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 88ea11d57c6f..2355e0a9eda0 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1083,7 +1083,7 @@ static int record__synthesize(struct record *rec, bool tail) return err; } - err = perf_event__synthesize_bpf_events(tool, process_synthesized_event, + err = perf_event__synthesize_bpf_events(session, process_synthesized_event, machine, opts); if (err < 0) pr_warning("Couldn't synthesize bpf events.\n"); diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 5a486d4de56e..27d8d42e0a4d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1216,7 +1216,7 @@ static int __cmd_top(struct perf_top *top) init_process_thread(top); - ret = perf_event__synthesize_bpf_events(&top->tool, perf_event__process, + ret = perf_event__synthesize_bpf_events(top->session, perf_event__process, &top->session->machines.host, &top->record_opts); if (ret < 0) diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index e6dfb95029e5..ff7ee149ec46 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -10,6 +10,7 @@ #include "debug.h" #include "symbol.h" #include "machine.h" +#include "session.h" #define ptr_to_u64(ptr) ((__u64)(unsigned long)(ptr)) @@ -42,7 +43,7 @@ int machine__process_bpf_event(struct machine *machine __maybe_unused, * -1 for failures; * -2 for lack of kernel support. */ -static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool, +static int perf_event__synthesize_one_bpf_prog(struct perf_session *session, perf_event__handler_t process, struct machine *machine, int fd, @@ -52,6 +53,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool, struct ksymbol_event *ksymbol_event = &event->ksymbol_event; struct bpf_event *bpf_event = &event->bpf_event; struct bpf_prog_info_linear *info_linear; + struct perf_tool *tool = session->tool; struct bpf_prog_info *info; struct btf *btf = NULL; bool has_btf = false; @@ -175,7 +177,7 @@ static int perf_event__synthesize_one_bpf_prog(struct perf_tool *tool, return err ? -1 : 0; } -int perf_event__synthesize_bpf_events(struct perf_tool *tool, +int perf_event__synthesize_bpf_events(struct perf_session *session, perf_event__handler_t process, struct machine *machine, struct record_opts *opts) @@ -209,7 +211,7 @@ int perf_event__synthesize_bpf_events(struct perf_tool *tool, continue; } - err = perf_event__synthesize_one_bpf_prog(tool, process, + err = perf_event__synthesize_one_bpf_prog(session, process, machine, fd, event, opts); close(fd); diff --git a/tools/perf/util/bpf-event.h b/tools/perf/util/bpf-event.h index 7890067e1a37..6698683612a7 100644 --- a/tools/perf/util/bpf-event.h +++ b/tools/perf/util/bpf-event.h @@ -15,7 +15,7 @@ struct record_opts; int machine__process_bpf_event(struct machine *machine, union perf_event *event, struct perf_sample *sample); -int perf_event__synthesize_bpf_events(struct perf_tool *tool, +int perf_event__synthesize_bpf_events(struct perf_session *session, perf_event__handler_t process, struct machine *machine, struct record_opts *opts); @@ -27,7 +27,7 @@ static inline int machine__process_bpf_event(struct machine *machine __maybe_unu return 0; } -static inline int perf_event__synthesize_bpf_events(struct perf_tool *tool __maybe_unused, +static inline int perf_event__synthesize_bpf_events(struct perf_session *session __maybe_unused, perf_event__handler_t process __maybe_unused, struct machine *machine __maybe_unused, struct record_opts *opts __maybe_unused) -- 2.17.1