Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp67917imm; Wed, 5 Sep 2018 15:07:45 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZVeLlCHWI7Xpm+ayJ2chXV0tikWXDB6M3yCIiPm3TpsIi1vexBpM5PIudaxW663fwhcsyb X-Received: by 2002:a62:7046:: with SMTP id l67-v6mr4570871pfc.84.1536185265713; Wed, 05 Sep 2018 15:07:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185265; cv=none; d=google.com; s=arc-20160816; b=n3Pp2xThQExLyKych9OfRlSmNKzgPnIEoKIusKafa7bDsuUj5Mri68TVIC6uZ1wWrv GXPkMeEbpf8kKZ44HL88c7wOywBTbrDfd1w8heWJi4jxtSDuwODKYxhMs9w7/iOtxzOC rFsi/ikfKZB1Q933aeQ2giKYz0lcDdslZ1LgdJHsOWYp8oAqyRkOKCDTpPx7GRM9mpSq +f4kaDRRSk890JU6LOzCele5fsNEV1e5bcNgVJAfPceX4JfSk0CqECwoKEg48hEqfzKM PApbm/Jqs97w5urzYmVP5dihTKF1Y4xl8VzEx+fdpjnqjauwEj9pxR662FVC4+UkGXJg 5xbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qfnM6svkkUnxY4l0K1gLuCUYGFkGopUBJXgaN/E1rzg=; b=G6uAdaOjoVIcIZULJPT0UJ9mOC7xOfpokZrEu/6GoqdLsxKJM7UwCWwsSV5Vsk0enR snRBAG0is4/VSPrUcGDCH7sNcxfKqEsbPf5Vd7Eol+8Kp8gCMrB/DcG9JROAK7Sy4KdQ 6rCmL7Y1qhCLl9CCMCjSFw1ppG7TfPxr7+o7titaygwI8XrRZ93G/eW+/soVWOs7s7s2 oQZh+QuOGohMqgn2TImrkNUNGKMQNE2Kog/JnQ/L5C7drhqvPwYBBt24NGJ3Au08KhKh Svqvi0h7XIcO9bgIehNiZtn5Pi0pQ/RzhpzuBOPDxHLDz5/be1nFLTuhjA2V5pS9/4We cpmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=UCOLRbuN; 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 s13-v6si3408361pfs.330.2018.09.05.15.07.30; Wed, 05 Sep 2018 15:07:45 -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=UCOLRbuN; 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 S1728283AbeIFChs (ORCPT + 99 others); Wed, 5 Sep 2018 22:37:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:52068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeIFChr (ORCPT ); Wed, 5 Sep 2018 22:37:47 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BF88120839; Wed, 5 Sep 2018 22:05:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185135; bh=0xompWM1BlahRca4Toab10TIxCmYO2//Yg+/KPpfmLI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=UCOLRbuNzh0lVPJnci/rfe4KVyncLDxoKSKU80euHchSNRC92PsoDnJ4qNEytGUsV wuV0CqnH8w7raq+zaHwwWYdVMhansnPlc06QX96vGJAEzJWYyK4QRregmsBfRV5+aB SRLpwPUizQffsfuWn9RU6WuxBwjgU8ZuXpkjJ+z0= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 16/77] perf trace augmented_syscalls: Augment bind's 'myaddr' sockaddr arg Date: Wed, 5 Sep 2018 19:03:39 -0300 Message-Id: <20180905220440.20256-17-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180905220440.20256-1-acme@kernel.org> References: <20180905220440.20256-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo One more, to reuse the augmented_sockaddr_syscall_enter() macro introduced from the augmentation of connect's sockaddr arg, also to get a subset of the struct arg augmentations done using the manual method, before switching to something automatic, using tracefs's format file or, even better, BTF containing the syscall args structs. # perf trace -e tools/perf/examples/bpf/augmented_syscalls.c 0.000 sshd/11479 bind(fd: 3, umyaddr: { .family: NETLINK }, addrlen: 12) 1.752 sshd/11479 bind(fd: 3, umyaddr: { .family: INET, port: 22, addr: 0.0.0.0 }, addrlen: 16) 1.924 sshd/11479 bind(fd: 4, umyaddr: { .family: INET6, port: 22, addr: :: }, addrlen: 28) ^C# Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-a2drqpahpmc7uwb3n3gj2plu@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 2 ++ tools/perf/examples/bpf/augmented_syscalls.c | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index ab2ed30b8dcc..537bb30895df 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -621,6 +621,8 @@ static struct syscall_fmt { } syscall_fmts[] = { { .name = "access", .arg = { [1] = { .scnprintf = SCA_ACCMODE, /* mode */ }, }, }, + { .name = "bind", + .arg = { [1] = { .scnprintf = SCA_SOCKADDR, /* umyaddr */ }, }, }, { .name = "bpf", .arg = { [0] = STRARRAY(cmd, bpf_cmd), }, }, { .name = "brk", .hexret = true, diff --git a/tools/perf/examples/bpf/augmented_syscalls.c b/tools/perf/examples/bpf/augmented_syscalls.c index 5f417e528419..71edb7ad8698 100644 --- a/tools/perf/examples/bpf/augmented_syscalls.c +++ b/tools/perf/examples/bpf/augmented_syscalls.c @@ -122,6 +122,16 @@ int syscall_enter(syscall)(struct syscall_enter_##syscall##_args *args) \ struct sockaddr; +struct syscall_enter_bind_args { + unsigned long long common_tp_fields; + long syscall_nr; + long fd; + struct sockaddr *addr_ptr; + unsigned long addrlen; +}; + +augmented_sockaddr_syscall_enter(bind); + struct syscall_enter_connect_args { unsigned long long common_tp_fields; long syscall_nr; -- 2.14.4