Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp603476ybz; Wed, 29 Apr 2020 06:13:19 -0700 (PDT) X-Google-Smtp-Source: APiQypKbFsbJuKBJViRwfR1YeT8M54M96bDNC5Yym01PSd3AH/9cdidhQdqwfmtyaA6NNqhPs94t X-Received: by 2002:a50:b286:: with SMTP id p6mr2368211edd.350.1588165999052; Wed, 29 Apr 2020 06:13:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588165999; cv=none; d=google.com; s=arc-20160816; b=S3g3sniTtIDFLOEP+v/ByIXz2Up+kQe7bJKooPwVfgZz2J2fCDxB/TGYJBb4aWs1PZ 4+Chj3j7Eb9tpQ3tq6cBbsxWMFGy9M0g+tcBobdYjDe2sfGF11IvI+DNYi+fhfnIPEDg SmnKQCzCBl0ET4evZHds8HkslqMI8cHMigR4PdRPBBtyAHk+pX3SRLP1w0YhCV2xy5hW +Jvub35vlxkzIRiUIheQW79B2XIGntWxq9mR0cqqw9jfNvgDBa6Nn/J22F4uai9jVpgD g83Zbf1LQSUMUAce/v2fTNZJxrPSn2aV8GoBTLX1dCZZb5usALJk4vKmZf5C7Eb5UdT6 R6Rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Htbl5J3aNAxvmQrTd63nMHjYQ7GMcYR0ifcPZRc7Mjk=; b=M9d5KRjRCvjaLIgOGVXyZlHGBiVQ3Q3/5tNQGbayKdDNmcdKlxgEhgdxGaouYOrRJn ESvD6pVog7S8UC0tMkQxi6Z/rimkIW2gdoGkiluPr2gazrUEb2vH5RSBnJvzZ4pATSA1 QuBp+JnsWXspTBfhDk3msx/3xC2RcjbAfQxhvia7ruBcW34MhHpUllYLZaqJ1hDLVamD L8ohr5GunlZOcDJjq3f15rldlR3D+2XF2ncKy+1xxI50m+Vetjyy6x2xrP6g5I3TtQN6 e2lrlmo9s8KWkWuQVu/pVOYs/DJRrnvSMoVHkIHY4axsgLEE8kXZz9W+bOv38u/0nGkQ syjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uBvICRrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id cn25si3356586edb.589.2020.04.29.06.12.54; Wed, 29 Apr 2020 06:13:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=uBvICRrR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1727030AbgD2NLV (ORCPT + 99 others); Wed, 29 Apr 2020 09:11:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:47804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726617AbgD2NLT (ORCPT ); Wed, 29 Apr 2020 09:11:19 -0400 Received: from quaco.ghostprotocols.net (unknown [179.97.37.151]) (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 BD20D22204; Wed, 29 Apr 2020 13:11:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588165879; bh=tKFHU4HAli4YzghcBR+NGFEMHmP0uRNWWbMCGXiTSE0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uBvICRrRQwcCtNZbYoKPs6UP691iwBj1PpzDtez40USDriGgjSBmoZHqDE2b2Cqc+ Rj/gokIrbh/q6xZlnQbQJSBE8qMcXC4NAESbcWE2BRx/cRxvYRBSXIcJ0tefJhWYWp ILfjlW4KqWZ4N6sSkYgHdTwbxxkCGf4Vo1gD/MZs= From: Arnaldo Carvalho de Melo To: Jiri Olsa , Namhyung Kim Cc: Ingo Molnar , Thomas Gleixner , Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , Song Liu Subject: [PATCH 2/8] perf top: Move sb_evlist to 'struct perf_top' Date: Wed, 29 Apr 2020 10:11:00 -0300 Message-Id: <20200429131106.27974-3-acme@kernel.org> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200429131106.27974-1-acme@kernel.org> References: <20200429131106.27974-1-acme@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo Where state related to a 'perf top' session is grouped. Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Song Liu Link: http://lore.kernel.org/lkml/20200427211935.25789-3-acme@kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 7 +++---- tools/perf/util/top.h | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 6b067a5ba1d5..70e1c732db6a 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1580,7 +1580,6 @@ int cmd_top(int argc, const char **argv) OPTS_EVSWITCH(&top.evswitch), OPT_END() }; - struct evlist *sb_evlist = NULL; const char * const top_usage[] = { "perf top []", NULL @@ -1744,9 +1743,9 @@ int cmd_top(int argc, const char **argv) } if (!top.record_opts.no_bpf_event) - bpf_event__add_sb_event(&sb_evlist, &perf_env); + bpf_event__add_sb_event(&top.sb_evlist, &perf_env); - if (perf_evlist__start_sb_thread(sb_evlist, target)) { + if (perf_evlist__start_sb_thread(top.sb_evlist, target)) { pr_debug("Couldn't start the BPF side band thread:\nBPF programs starting from now on won't be annotatable\n"); opts->no_bpf_event = true; } @@ -1754,7 +1753,7 @@ int cmd_top(int argc, const char **argv) status = __cmd_top(&top); if (!opts->no_bpf_event) - perf_evlist__stop_sb_thread(sb_evlist); + perf_evlist__stop_sb_thread(top.sb_evlist); out_delete_evlist: evlist__delete(top.evlist); diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index 45dc84ddff37..ff8391208ecd 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h @@ -18,7 +18,7 @@ struct perf_session; struct perf_top { struct perf_tool tool; - struct evlist *evlist; + struct evlist *evlist, *sb_evlist; struct record_opts record_opts; struct annotation_options annotation_opts; struct evswitch evswitch; -- 2.21.1