summaryrefslogtreecommitdiffstats
path: root/tools/perf/pmu-events/jevents.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/pmu-events/jevents.c')
-rw-r--r--tools/perf/pmu-events/jevents.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/tools/perf/pmu-events/jevents.c b/tools/perf/pmu-events/jevents.c
index bd0aabb..d51dc9c 100644
--- a/tools/perf/pmu-events/jevents.c
+++ b/tools/perf/pmu-events/jevents.c
@@ -137,6 +137,8 @@ static struct field {
{ "AnyThread", "any=" },
{ "EdgeDetect", "edge=" },
{ "SampleAfterValue", "period=" },
+ { "FCMask", "fc_mask=" },
+ { "PortMask", "ch_mask=" },
{ NULL, NULL }
};
@@ -822,10 +824,6 @@ static int process_one_file(const char *fpath, const struct stat *sb,
* PMU event tables (see struct pmu_events_map).
*
* Write out the PMU events tables and the mapping table to pmu-event.c.
- *
- * If unable to process the JSON or arch files, create an empty mapping
- * table so we can continue to build/use perf even if we cannot use the
- * PMU event aliases.
*/
int main(int argc, char *argv[])
{
@@ -836,6 +834,7 @@ int main(int argc, char *argv[])
const char *arch;
const char *output_file;
const char *start_dirname;
+ struct stat stbuf;
prog = basename(argv[0]);
if (argc < 4) {
@@ -857,11 +856,17 @@ int main(int argc, char *argv[])
return 2;
}
+ sprintf(ldirname, "%s/%s", start_dirname, arch);
+
+ /* If architecture does not have any event lists, bail out */
+ if (stat(ldirname, &stbuf) < 0) {
+ pr_info("%s: Arch %s has no PMU event lists\n", prog, arch);
+ goto empty_map;
+ }
+
/* Include pmu-events.h first */
fprintf(eventsfp, "#include \"../../pmu-events/pmu-events.h\"\n");
- sprintf(ldirname, "%s/%s", start_dirname, arch);
-
/*
* The mapfile allows multiple CPUids to point to the same JSON file,
* so, not sure if there is a need for symlinks within the pmu-events
@@ -878,6 +883,9 @@ int main(int argc, char *argv[])
if (rc && verbose) {
pr_info("%s: Error walking file tree %s\n", prog, ldirname);
goto empty_map;
+ } else if (rc < 0) {
+ /* Make build fail */
+ return 1;
} else if (rc) {
goto empty_map;
}
@@ -892,7 +900,8 @@ int main(int argc, char *argv[])
if (process_mapfile(eventsfp, mapfile)) {
pr_info("%s: Error processing mapfile %s\n", prog, mapfile);
- goto empty_map;
+ /* Make build fail */
+ return 1;
}
return 0;
OpenPOWER on IntegriCloud