From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753372AbbIKQAS (ORCPT ); Fri, 11 Sep 2015 12:00:18 -0400 Received: from mga02.intel.com ([134.134.136.20]:52365 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750958AbbIKQAR (ORCPT ); Fri, 11 Sep 2015 12:00:17 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,511,1437462000"; d="scan'208";a="802515487" From: Alexander Shishkin To: Peter Zijlstra , Ingo Molnar Cc: linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, johannes@sipsolutions.net, Arnaldo Carvalho de Melo , Alexander Shishkin Subject: [PATCH RFC v3 0/6] Introduce extended syscall error reporting Date: Fri, 11 Sep 2015 18:59:59 +0300 Message-Id: <1441987205-4021-1-git-send-email-alexander.shishkin@linux.intel.com> X-Mailer: git-send-email 2.5.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ingo, Peter and everybody, This is another stab at the error reporting problem. I've been sitting on this code for a couple of weeks now for no good reason, so I figured I'd just put it out there and see where we go next. This time around, the error reporting itself is a separate "infrastructure", which is mostly a header file infested with macros and some code to set it all up and deliver to userspace. The latter is now done with a prctl() like Ingo suggested. This is the first patch. Then, it gets integrated into perf core and one example error return is annotated with a message. The rest of the patchset adds support to perf tooling, which includes its own JSON parser (I wasn't aware that Andi was bringing one in with one of his pull requests at the moment of writing it and I still like it better not only because of the NIH symptoms) and extends perf_evsel__open_strerror() to fetch these error messages from the kernel. I didn't include all the instrumentation that I did in the previous versions of the patchset to keep the noise level down. Alexander Shishkin (6): exterr: Introduce extended syscall error reporting perf: Use extended syscall error reporting perf/x86: Annotate a BTS error with extended error reporting perf tools: Add a simple JSON parser perf tools: Add userspace counterpart for extended error reporting perf tools: Use extended syscall error reporting arch/x86/kernel/cpu/perf_event.c | 5 +- include/linux/exterr.h | 99 ++++++++++++++++ include/linux/perf_event.h | 14 +++ include/linux/sched.h | 1 + include/uapi/linux/prctl.h | 5 + kernel/events/core.c | 17 ++- kernel/sys.c | 6 + lib/Makefile | 2 + lib/exterr.c | 157 ++++++++++++++++++++++++ tools/include/tools/json.h | 40 +++++++ tools/lib/util/json.c | 250 +++++++++++++++++++++++++++++++++++++++ tools/perf/util/Build | 6 + tools/perf/util/evsel.c | 12 +- tools/perf/util/exterr.c | 79 +++++++++++++ tools/perf/util/exterr.h | 21 ++++ 15 files changed, 711 insertions(+), 3 deletions(-) create mode 100644 include/linux/exterr.h create mode 100644 lib/exterr.c create mode 100644 tools/include/tools/json.h create mode 100644 tools/lib/util/json.c create mode 100644 tools/perf/util/exterr.c create mode 100644 tools/perf/util/exterr.h -- 2.5.1