summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/builtin-test.c
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2022-05-23 14:32:49 +0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2022-05-23 14:32:49 +0200
commit0869331fbaa2c11c9e94e45305d17ce447189a0a (patch)
treeceb7a26a3f39146dcf9bec3667ff19169bd5026b /tools/perf/tests/builtin-test.c
parentperf parse-events: Move slots event for the hybrid platform too (diff)
parentLinux 5.18 (diff)
downloadlinux-0869331fbaa2c11c9e94e45305d17ce447189a0a.tar.xz
linux-0869331fbaa2c11c9e94e45305d17ce447189a0a.zip
Merge remote-tracking branch 'torvalds/master' into perf/core
To get the rest of 5.18. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/builtin-test.c')
-rw-r--r--tools/perf/tests/builtin-test.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index 3c34cb766724..aa40eae1c9cf 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -279,6 +279,7 @@ static const char *shell_test__description(char *description, size_t size,
{
FILE *fp;
char filename[PATH_MAX];
+ int ch;
path__join(filename, sizeof(filename), path, name);
fp = fopen(filename, "r");
@@ -286,7 +287,9 @@ static const char *shell_test__description(char *description, size_t size,
return NULL;
/* Skip shebang */
- while (fgetc(fp) != '\n');
+ do {
+ ch = fgetc(fp);
+ } while (ch != EOF && ch != '\n');
description = fgets(description, size, fp);
fclose(fp);
@@ -419,7 +422,8 @@ static int run_shell_tests(int argc, const char *argv[], int i, int width,
.priv = &st,
};
- if (!perf_test__matches(test_suite.desc, curr, argc, argv))
+ if (test_suite.desc == NULL ||
+ !perf_test__matches(test_suite.desc, curr, argc, argv))
continue;
st.file = ent->d_name;