Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2021 20:39:20 GMT
From:      Mitchell Horne <mhorne@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 0c915023dbb7 - main - libpmc: remove pe->alias
Message-ID:  <202105312039.14VKdKWN040658@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c915023dbb7000cd30bb768eb84f6dc757adcc5

commit 0c915023dbb7000cd30bb768eb84f6dc757adcc5
Author:     Mitchell Horne <mhorne@FreeBSD.org>
AuthorDate: 2021-05-31 14:23:19 +0000
Commit:     Mitchell Horne <mhorne@FreeBSD.org>
CommitDate: 2021-05-31 20:39:05 +0000

    libpmc: remove pe->alias
    
    It has never been a part of upstream's struct pmu_event. The jevents
    utility will not fill this field, so remove it.
    
    Reviewed by:    gnn
    MFC after:      2 weeks
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D30530
---
 lib/libpmc/libpmc_pmu_util.c       | 4 ----
 lib/libpmc/pmu-events/pmu-events.h | 1 -
 2 files changed, 5 deletions(-)

diff --git a/lib/libpmc/libpmc_pmu_util.c b/lib/libpmc/libpmc_pmu_util.c
index a525a0067822..90ce0feafa52 100644
--- a/lib/libpmc/libpmc_pmu_util.c
+++ b/lib/libpmc/libpmc_pmu_util.c
@@ -302,8 +302,6 @@ pmc_pmu_sample_rate_get(const char *event_name)
 	event_name = pmu_alias_get(event_name);
 	if ((pe = pmu_event_get(NULL, event_name, NULL)) == NULL)
 		return (DEFAULT_SAMPLE_COUNT);
-	if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, NULL)) == NULL)
-		return (DEFAULT_SAMPLE_COUNT);
 	if (pe->event == NULL)
 		return (DEFAULT_SAMPLE_COUNT);
 	if (pmu_parse_event(&ped, pe->event))
@@ -526,8 +524,6 @@ pmc_pmu_pmcallocate(const char *event_name, struct pmc_op_pmcallocate *pm)
 	event_name = pmu_alias_get(event_name);
 	if ((pe = pmu_event_get(NULL, event_name, &idx)) == NULL)
 		return (ENOENT);
-	if (pe->alias && (pe = pmu_event_get(NULL, pe->alias, &idx)) == NULL)
-		return (ENOENT);
 	assert(idx >= 0);
 	pm->pm_ev = idx;
 
diff --git a/lib/libpmc/pmu-events/pmu-events.h b/lib/libpmc/pmu-events/pmu-events.h
index c4c01e20114d..cfc82f20364c 100644
--- a/lib/libpmc/pmu-events/pmu-events.h
+++ b/lib/libpmc/pmu-events/pmu-events.h
@@ -10,7 +10,6 @@
  */
 struct pmu_event {
 	const char *name;
-	const char *alias;
 	const char *event;
 	const char *desc;
 	const char *topic;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105312039.14VKdKWN040658>