From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14F95C43331 for ; Tue, 24 Mar 2020 10:26:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF83120870 for ; Tue, 24 Mar 2020 10:26:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="OQhxlRRj" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727337AbgCXKZ7 (ORCPT ); Tue, 24 Mar 2020 06:25:59 -0400 Received: from us-smtp-delivery-74.mimecast.com ([216.205.24.74]:35326 "EHLO us-smtp-delivery-74.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726697AbgCXKZ7 (ORCPT ); Tue, 24 Mar 2020 06:25:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585045557; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YRjdfdefaqhNj49BdQQDHV2kO4Tm7PbH4nOc30QhTz4=; b=OQhxlRRj+6+N8WE7mjZnHqjivlydWBj7UcRJ+PG/fsph/OwL3OIQ31s4TUXI3hEhsldXqe gA0AvYY2UcnGfgAoWyGNfiPav/ZrHxpRIJCWN+VSqJn+p6bMV5cy+m7gHYAfMHf1s6iquJ AZCKwiTJK3I46g6NeWNCPnfvvWiOE1A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-259-TG1H4V6LM1KBS-ysRkT1Bw-1; Tue, 24 Mar 2020 06:25:54 -0400 X-MC-Unique: TG1H4V6LM1KBS-ysRkT1Bw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 62E51800D5A; Tue, 24 Mar 2020 10:25:50 +0000 (UTC) Received: from krava (unknown [10.40.192.119]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7C3F6BBBC2; Tue, 24 Mar 2020 10:25:34 +0000 (UTC) Date: Tue, 24 Mar 2020 11:25:28 +0100 From: Jiri Olsa To: Ian Rogers Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Yonghong Song , Andrii Nakryiko , Greg Kroah-Hartman , Thomas Gleixner , Igor Lubashev , Alexey Budankov , Florian Fainelli , Adrian Hunter , Andi Kleen , Jiwei Sun , yuzhoujian , Kan Liang , Jin Yao , Leo Yan , John Garry , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org, linux-perf-users@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH v5] perf tools: add support for libpfm4 Message-ID: <20200324102528.GM1534489@krava> References: <20200323235846.104937-1-irogers@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200323235846.104937-1-irogers@google.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 Sender: bpf-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: bpf@vger.kernel.org On Mon, Mar 23, 2020 at 04:58:46PM -0700, Ian Rogers wrote: SNIP > diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c > index 616fbda7c3fc..11421f5dc9cb 100644 > --- a/tools/perf/util/pmu.c > +++ b/tools/perf/util/pmu.c > @@ -869,6 +869,17 @@ static struct perf_pmu *pmu_find(const char *name) > return NULL; > } > > +struct perf_pmu *perf_pmu__find_by_type(unsigned int type) > +{ > + struct perf_pmu *pmu; > + > + list_for_each_entry(pmu, &pmus, list) > + if (pmu->type == type) > + return pmu; > + > + return NULL; > +} please move this to separate patch thanks, jirka > + > struct perf_pmu *perf_pmu__scan(struct perf_pmu *pmu) > { > /* > diff --git a/tools/perf/util/pmu.h b/tools/perf/util/pmu.h > index 5fb3f16828df..de3b868d912c 100644 > --- a/tools/perf/util/pmu.h > +++ b/tools/perf/util/pmu.h > @@ -65,6 +65,7 @@ struct perf_pmu_alias { > }; > > struct perf_pmu *perf_pmu__find(const char *name); > +struct perf_pmu *perf_pmu__find_by_type(unsigned int type); > int perf_pmu__config(struct perf_pmu *pmu, struct perf_event_attr *attr, > struct list_head *head_terms, > struct parse_events_error *error); > -- > 2.25.1.696.g5e7596f4ac-goog >