Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5643584img; Wed, 27 Mar 2019 12:18:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqwVEyDACIane9d9CS8F+dqfKvOG45EuXRAFIvqCuRZT6bLCFAvuDD81m2JEMYQktvyd970l X-Received: by 2002:a62:2046:: with SMTP id g67mr31536535pfg.121.1553714307810; Wed, 27 Mar 2019 12:18:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714307; cv=none; d=google.com; s=arc-20160816; b=KILXBPy6KKfk+Clox8gsYiurVoWyN/1fbCjo904q/MlT7Rw7z91BtjwdHyxpaYstNV X5dGKESsbUG/fGpdCaYwqhn8Mt0wOpG5C1JV7Q56K1/+d0E2tbWqeQhyWNKYTRWKiR8o HkxWVJ5YvxMFSg6CyfJPyO1gTxH9iCHn07W8GRbO0DhpRP0XYtbNme9L0hdwpYnGRn2R /OK19j2/EzgpRc9bPlQljaNOkFLm7YCK4T7/dMO/IeFkjAW2IHuAMZ7xdagtMjHJj4jM fL2njwiH2nPmLlHaQpHGNs3/P2vQMQgwEtv13YTVqHql+yQ7fT/8w9uY8JdC7X0cka+J mz6A== 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 :dkim-signature; bh=gr6pY6716DJzA7zbQAEICbLE28jCQaHAZplpaAf3i8Y=; b=ZhAv3vkqIiVG02Ypg4q9z/aNJXAMND4SugBs3IMSSjRHkjnIs2o115KZJjNjIC5jlw ZR7lcq8lRvpbpYKf6jDldK/n8flATEn8RxvS773U+riPXY5MPMOBtV8TswR6y7t3QlJD 2/iid/KK35a8CJVyl0MYh/KBFDxAxOiYA4aTzI2J/DA9hb87PmBIXhAstiRkvYTHi8nJ N6kAycidcPx+bmiNF9OcB11nh//zU3IvkkxZWZYxNMHY+nxYWVyrzsMmCTBKPhqC/PDg KnQW2FwwvbIQexvnxQf7lnOV59PLibyaFiZV+rVEut996vEHwg0tEdYEq0YpP5VFaWEN 1lDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iXxGSOiy; 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=pass (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 f4si19219988pfc.96.2019.03.27.12.18.12; Wed, 27 Mar 2019 12:18:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b=iXxGSOiy; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388472AbfC0SI7 (ORCPT + 99 others); Wed, 27 Mar 2019 14:08:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:50696 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387999AbfC0SIz (ORCPT ); Wed, 27 Mar 2019 14:08:55 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A47F52070B; Wed, 27 Mar 2019 18:08:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710134; bh=w+Vvd2y1B8Z3wlfT+W1UuXQPgU+xZDZrvTfZvP//Md4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iXxGSOiyNq4KaoWArVawHPQ+K2fOKYYgxrfOGj9tFJkiL84P/bWayXTkQxyPKUIN4 e833596Q0PLen+4u4twZkEZtsEdFJ6rzSiGx6XGghGaHHlfUFtmaLmhQTP6ITCJj+5 GeTc6AtyzyvPQ34k/VrpoVfBNBwPNtssukAsHpAY= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Arnaldo Carvalho de Melo , Adrian Hunter , Jiri Olsa , =?UTF-8?q?Luis=20Cl=C3=A1udio=20Gon=C3=A7alves?= , Namhyung Kim , Wang Nan , Sasha Levin , netdev@vger.kernel.org, bpf@vger.kernel.org Subject: [PATCH AUTOSEL 5.0 212/262] perf trace: Fixup etcsnoop example Date: Wed, 27 Mar 2019 14:01:07 -0400 Message-Id: <20190327180158.10245-212-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo [ Upstream commit 1d59cb1bbd4cbe5a8f8032242cdacea5658129cf ] Where we don't have "raw_syscalls:sys_enter", so we need to look for a "*syscalls:sys_enter*" to initialize the offsets for the __augmented_syscalls__ evsel, which is the case with etcsnoop, that was segfaulting, fixed: # trace -e /home/acme/git/perf/tools/perf/examples/bpf/etcsnoop.c 0.000 ( ): gnome-shell/2105 openat(dfd: CWD, filename: "/etc/localtime") ... 631.834 ( ): cat/6521 openat(dfd: CWD, filename: "/etc/ld.so.cache", flags: RDONLY|CLOEXEC) ... 632.637 ( ): bash/6521 openat(dfd: CWD, filename: "/etc/passwd") ... ^C# Cc: Adrian Hunter Cc: Jiri Olsa Cc: Luis Cláudio Gonçalves Cc: Namhyung Kim Cc: Wang Nan Fixes: b9b6a2ea2baf ("perf trace: Do not hardcode the size of the tracepoint common_ fields") Link: https://lkml.kernel.org/n/tip-0tjwcit8qitsmh4nyvf2b0jo@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo Signed-off-by: Sasha Levin --- tools/perf/builtin-trace.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 2776ff8c3e81..91cdbf504535 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -3868,7 +3868,8 @@ int cmd_trace(int argc, const char **argv) goto init_augmented_syscall_tp; } - if (strcmp(perf_evsel__name(evsel), "raw_syscalls:sys_enter") == 0) { + if (trace.syscalls.events.augmented->priv == NULL && + strstr(perf_evsel__name(evsel), "syscalls:sys_enter")) { struct perf_evsel *augmented = trace.syscalls.events.augmented; if (perf_evsel__init_augmented_syscall_tp(augmented, evsel) || perf_evsel__init_augmented_syscall_tp_args(augmented)) -- 2.19.1