diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 73b5d7f9119482759be56761f17f01c21226e297..53c9892e96dd038ec3aa355db6fc00514dd75291 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -317,6 +317,11 @@ static int perf_record__open(struct perf_record *rec) perf_evsel__name(pos)); rc = -err; goto out; + } else if ((err == EOPNOTSUPP) && (attr->precise_ip)) { + ui__error("\'precise\' request may not be supported. " + "Try removing 'p' modifier\n"); + rc = -err; + goto out; } printf("\n"); diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index fb9da71eba1f63fdcd9e4a8fcbb20ac62f7ed107..f2ecd498c72da95df18661fdbf4a5457151f4ebd 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -977,6 +977,10 @@ static void perf_top__start_counters(struct perf_top *top) ui__error("Too many events are opened.\n" "Try again after reducing the number of events\n"); goto out_err; + } else if ((err == EOPNOTSUPP) && (attr->precise_ip)) { + ui__error("\'precise\' request may not be supported. " + "Try removing 'p' modifier\n"); + goto out_err; } ui__error("The sys_perf_event_open() syscall "