Merge tag 'tty-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty
[cascardo/linux.git] / tools / perf / builtin-stat.c
index 90882b1..688dea7 100644 (file)
@@ -52,6 +52,7 @@
 #include "util/evlist.h"
 #include "util/evsel.h"
 #include "util/debug.h"
+#include "util/drv_configs.h"
 #include "util/color.h"
 #include "util/stat.h"
 #include "util/header.h"
@@ -540,6 +541,7 @@ static int __run_perf_stat(int argc, const char **argv)
        int status = 0;
        const bool forks = (argc > 0);
        bool is_pipe = STAT_RECORD ? perf_stat.file.is_pipe : false;
+       struct perf_evsel_config_term *err_term;
 
        if (interval) {
                ts.tv_sec  = interval / USEC_PER_MSEC;
@@ -611,6 +613,13 @@ try_again:
                return -1;
        }
 
+       if (perf_evlist__apply_drv_configs(evsel_list, &counter, &err_term)) {
+               error("failed to set config \"%s\" on event %s with %d (%s)\n",
+                     err_term->val.drv_cfg, perf_evsel__name(counter), errno,
+                     str_error_r(errno, msg, sizeof(msg)));
+               return -1;
+       }
+
        if (STAT_RECORD) {
                int err, fd = perf_data_file__fd(&perf_stat.file);