lkml.org 
[lkml]   [2011]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] perf_event: Return -EINVAL for Offcore Response Events

If we really are going to ban raw access to Offcore Response events for a
while, then we should return a proper error code. Right now we return "0"
which gives tools the false impression that opening the event worked.

Vince
vweaver1@eecs.utk.edu


diff --git a/arch/x86/kernel/cpu/perf_event.c b/arch/x86/kernel/cpu/perf_event.c
index 3a0338b..c6bfa6b 100644
--- a/arch/x86/kernel/cpu/perf_event.c
+++ b/arch/x86/kernel/cpu/perf_event.c
@@ -598,7 +598,7 @@ static int x86_setup_perfctr(struct perf_event *event)
* there's no sane user-space generalization yet:
*/
if (attr->type == PERF_TYPE_RAW)
- return 0;
+ return -EINVAL;

if (attr->type == PERF_TYPE_HW_CACHE)
return set_ext_hw_attr(hwc, event);

\
 
 \ /
  Last update: 2011-06-10 22:11    [W:0.042 / U:0.692 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site