git: 3a9b3a847026 - stable/13 - libpmc: remove pe->alias

Mitchell Horne mhorne at FreeBSD.org
Thu Jul 29 15:25:25 UTC 2021


The branch stable/13 has been updated by mhorne:

URL: https://cgit.FreeBSD.org/src/commit/?id=3a9b3a8470261d052d25a2a2b628a0dd214d1091

commit 3a9b3a8470261d052d25a2a2b628a0dd214d1091
Author:     Mitchell Horne <mhorne at FreeBSD.org>
AuthorDate: 2021-05-31 14:23:19 +0000
Commit:     Mitchell Horne <mhorne at FreeBSD.org>
CommitDate: 2021-07-29 15:01:10 +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
    
    (cherry picked from commit 0c915023dbb7000cd30bb768eb84f6dc757adcc5)
---
 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 1b2c10e07368..6a287a66a2f8 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;


More information about the dev-commits-src-branches mailing list