Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp68280imm; Wed, 5 Sep 2018 15:08:05 -0700 (PDT) X-Google-Smtp-Source: ANB0Vda3ez1puIQ3hMAbyy11e9N52aYAJrS2sFtfNq62TuGAWlKSq0hUs2TW+cwu4CSQhcc2VbSB X-Received: by 2002:a62:8913:: with SMTP id v19-v6mr43097798pfd.127.1536185284989; Wed, 05 Sep 2018 15:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185284; cv=none; d=google.com; s=arc-20160816; b=XwScDg/PCxjTUeA9769MumHE4UV/fZKfNxz67hfEFjq2DhHqX+aNj1yqYgpuaeug6H W4eWW+YHFS4ysAuleE/nsdT5itXkKtL08cwEOmd9AReo3YIk2os0ezrqV3kVdZDaxk2W EX6zeANdqq0td9U2oQ3C5bYPw5eOIMtVRydj2s/Qv1RUcpYSTgAiebiCI/qGC5+fqMXX z9X5mnUFhfvZRys0RbcFbHKzTdJdR6+Ga2LAXAEsp+rkP58lkCI4Gm2SUZKJwcxGCb8T A9JbUSLypp4hf2PBaIPu/SeEB7+Mo96BUpHYsJ++Q5h2MJp2W0cwI6Mi4IKJlo9Fn77S pNEg== 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=e8iu1jJm3yEJZczv02AxHPkolUApa5v8Gq0gJg39psg=; b=dx1RX+zpocLvkRb+3ScwLplew5IcwvS513z23PxOJsdHunIFoFNsyoFLMWErevHSJq ocJu0Br1yCuF3zND5EX8YopUZuQUV9GhKyrCODw7tcSfSdXc87uJbRVr8/9hUyO5LpnS Zs/z7gStuhRZ1MJinicFHlKpf4Wrm7aDNppLHGWFzFxOENzsfu92HLv12TYl9XE/CUbX Jeskoh/7hZ7q8OIGn0e820radDwejKserGeEJ0HQE+4yqqO9o+NSfFsds0SiEHl5+qQp MY/ipDWPe7IXoVMEVk/oBJkRJsD8dwHwf8TqVo3HFwJan0UW9I/HNQJzVr7uVeuoP/et 0uqQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=mumjldrC; 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 w8-v6si3262438plk.222.2018.09.05.15.07.49; Wed, 05 Sep 2018 15:08:04 -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=mumjldrC; 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 S1728299AbeIFChu (ORCPT + 99 others); Wed, 5 Sep 2018 22:37:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:52152 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeIFCht (ORCPT ); Wed, 5 Sep 2018 22:37:49 -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 62F1F20652; Wed, 5 Sep 2018 22:05:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185138; bh=RHleLS95RrIRFygpB6++04e/XDsiLDBxXRgxSKtWL8c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mumjldrCGKWMFSw2GiSE8+ns154yd9cebs4hq30MAcfkCkC4siyKchhIxgKuX/mNk o6gv6jemTz0cTuE1+CUTLyMYF/3CBQCzP/TGujR+lMKkBFsQbXQsDsWQolgxAuYp4N a4ZjjzkhG7GlZ67oE7eV9BGfafNadkzATPnGZZT0= 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 17/77] perf trace augmented_syscalls: Augment sendto's 'addr' arg Date: Wed, 5 Sep 2018 19:03:40 -0300 Message-Id: <20180905220440.20256-18-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 Its a 'struct sockaddr' pointer, augment it with the same beautifier as for 'connect' and 'bind', that all receive from userspace that pointer. Doing it in the other direction remains to be done, hooking at the syscalls:sys_exit_{accept4?,recvmsg} tracepoints somehow. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-k2eu68lsphnm2fthc32gq76c@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 3 ++- tools/perf/examples/bpf/augmented_syscalls.c | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 537bb30895df..759d14e3fe6b 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -795,7 +795,8 @@ static struct syscall_fmt { { .name = "sendmsg", .arg = { [2] = { .scnprintf = SCA_MSG_FLAGS, /* flags */ }, }, }, { .name = "sendto", - .arg = { [3] = { .scnprintf = SCA_MSG_FLAGS, /* flags */ }, }, }, + .arg = { [3] = { .scnprintf = SCA_MSG_FLAGS, /* flags */ }, + [4] = { .scnprintf = SCA_SOCKADDR, /* addr */ }, }, }, { .name = "set_tid_address", .errpid = true, }, { .name = "setitimer", .arg = { [0] = STRARRAY(which, itimers), }, }, diff --git a/tools/perf/examples/bpf/augmented_syscalls.c b/tools/perf/examples/bpf/augmented_syscalls.c index 71edb7ad8698..be06d2c9e8c9 100644 --- a/tools/perf/examples/bpf/augmented_syscalls.c +++ b/tools/perf/examples/bpf/augmented_syscalls.c @@ -142,4 +142,17 @@ struct syscall_enter_connect_args { augmented_sockaddr_syscall_enter(connect); +struct syscall_enter_sendto_args { + unsigned long long common_tp_fields; + long syscall_nr; + long fd; + void *buff; + long len; + unsigned long flags; + struct sockaddr *addr_ptr; + long addr_len; +}; + +augmented_sockaddr_syscall_enter(sendto); + license(GPL); -- 2.14.4