Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp899580ybl; Wed, 28 Aug 2019 06:59:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzyNE+Hm4hv+hMIy4/mbgcuqFl22qZffdkR/Xo2CXHUb78wjUswFtaWbsnKtgUN3c2bd2F7 X-Received: by 2002:a17:90a:a4c5:: with SMTP id l5mr4389908pjw.49.1567000745807; Wed, 28 Aug 2019 06:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567000745; cv=none; d=google.com; s=arc-20160816; b=YBtHPrnQKHa85UJI15eObmujsQTKfkU6A32q518ykdHLtknx0xiVYC2sZNUD3kM79E 2su/UtC01MZ/2hcciFLMZDK7Ea6H4TKSU8L6QNIEoUQo/rpaDUTRzw7dHBBUiCBSPD1l vMcflS9LNQBN1KoZhOY/0xGkNsWJBCINtRkdtvrOUDKDAz/IJz2Ggp1slG8QeaGVWseb PLqTJQ73N7PLa/byfqcEjQ8AwcR2U5rFM7bbvaCcRFn1/2y0ElSJdgyPwAtVDcK40XZm wq8hs0RRRczBjOL+bz8ZJd+sZsfrGjFvz2oG4ynQsz51833iGF6q3VleTiOXqHEiZPcW FB5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Qux/UeHlRMRBihyxitE4up4EsVOCibglxNYKfj50sCw=; b=FLoA/rK25zwUNCm4lUx5UJ4BSZr8Ns3j1oIPjf8caiWk/y/nxGUpuFwDN4WaAZBoHp zrH71AU9tpIujaAkKeHwHfARvb42MVXNnovl7oIauHnwUxZjTBJURTPQiBE0WMxVtAlC ACgTKqO/rBtymX6vqvdIQmyJRysjt6SZ5p7/q1pktG/YIj7bIBRssnBj0mLRE3r3qeMj WUWDd/ZEzpsTUXlj4k6AKG83BELDF5FHInWp4bAh4dYYZi7E4REn1NB0T/L5a6x1VeX4 2zS6IfwP8TVfUlRGolaugT+npXAcbqzStOzmxct1rIkioROjlThQgfXks+6TxPZYjRkK WdOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k72si2160094pge.95.2019.08.28.06.58.49; Wed, 28 Aug 2019 06:59:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726941AbfH1N5q (ORCPT + 99 others); Wed, 28 Aug 2019 09:57:46 -0400 Received: from mx1.redhat.com ([209.132.183.28]:13415 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726901AbfH1N5l (ORCPT ); Wed, 28 Aug 2019 09:57:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4612110F09; Wed, 28 Aug 2019 13:57:41 +0000 (UTC) Received: from krava.brq.redhat.com (unknown [10.43.17.33]) by smtp.corp.redhat.com (Postfix) with ESMTP id 41B021001B09; Wed, 28 Aug 2019 13:57:38 +0000 (UTC) From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: lkml , Ingo Molnar , Namhyung Kim , Alexander Shishkin , Peter Zijlstra , Michael Petlan Subject: [PATCH 10/23] libperf: Add PERF_RECORD_AUXTRACE_ERROR 'struct auxtrace_error_event' to perf/event.h Date: Wed, 28 Aug 2019 15:57:04 +0200 Message-Id: <20190828135717.7245-11-jolsa@kernel.org> In-Reply-To: <20190828135717.7245-1-jolsa@kernel.org> References: <20190828135717.7245-1-jolsa@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 28 Aug 2019 13:57:41 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Move the PERF_RECORD_AUXTRACE_ERROR event definition to libperf's event.h. In order to keep libperf simple, we switch 'u64/u32/u16/u8' types used events to their generic '__u*' versions. Link: http://lkml.kernel.org/n/tip-2i1ggfthfst9ont7ulmejgwg@git.kernel.org Signed-off-by: Jiri Olsa --- tools/perf/lib/include/perf/event.h | 15 +++++++++++++++ tools/perf/util/auxtrace.c | 2 +- tools/perf/util/event.h | 15 --------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/tools/perf/lib/include/perf/event.h b/tools/perf/lib/include/perf/event.h index 78001c2973b6..6292b7c41bac 100644 --- a/tools/perf/lib/include/perf/event.h +++ b/tools/perf/lib/include/perf/event.h @@ -219,4 +219,19 @@ struct auxtrace_event { __u32 reserved__; /* For alignment */ }; +#define MAX_AUXTRACE_ERROR_MSG 64 + +struct auxtrace_error_event { + struct perf_event_header header; + __u32 type; + __u32 code; + __u32 cpu; + __u32 pid; + __u32 tid; + __u32 fmt; + __u64 ip; + __u64 time; + char msg[MAX_AUXTRACE_ERROR_MSG]; +}; + #endif /* __LIBPERF_EVENT_H */ diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 0d2ba1397e47..cddf04c45a20 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -1188,7 +1188,7 @@ size_t perf_event__fprintf_auxtrace_error(union perf_event *event, FILE *fp) if (!e->fmt) msg = (const char *)&e->time; - ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRIx64" code %u: %s\n", + ret += fprintf(fp, " cpu %d pid %d tid %d ip %#"PRI_lx64" code %u: %s\n", e->cpu, e->pid, e->tid, e->ip, e->code, msg); return ret; } diff --git a/tools/perf/util/event.h b/tools/perf/util/event.h index 60895a3b2c85..e334ecbe50a0 100644 --- a/tools/perf/util/event.h +++ b/tools/perf/util/event.h @@ -332,21 +332,6 @@ struct events_stats { u32 nr_proc_map_timeout; }; -#define MAX_AUXTRACE_ERROR_MSG 64 - -struct auxtrace_error_event { - struct perf_event_header header; - u32 type; - u32 code; - u32 cpu; - u32 pid; - u32 tid; - u32 fmt; - u64 ip; - u64 time; - char msg[MAX_AUXTRACE_ERROR_MSG]; -}; - struct aux_event { struct perf_event_header header; u64 aux_offset; -- 2.21.0