Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp838942ybl; Fri, 9 Aug 2019 14:51:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLw2KLO8vP6aNQPF36Qulg51oEEszxUa4n+kw5vplbkXHgzDuEguU334SvF76dKqZcieVG X-Received: by 2002:a62:2c93:: with SMTP id s141mr6521184pfs.114.1565387510087; Fri, 09 Aug 2019 14:51:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565387510; cv=none; d=google.com; s=arc-20160816; b=LRF5GFigHAHu0XLUf4xaVqFlDZ3ffjMTsxC69CZNaPKB9DeG7MGHdyJKPZo0WuNecF Mxduk6Ql2nHlv6//k/mN/HoAan4UPjdz6emPITgBraQ0epFKSDMDpm8tMFj1cb1MwKz3 SKmz3EqrQotPeoGxmjVa1qW+dDjm82hpqq6CZq5Qh8ty5Ruv1qbROjW2Wr+eWxy7ing3 9nJnvnVKG/QPRBO2GLo8AZ4fdVNUdROyHVSKpALnadGS2JIn60sp6p00se767zc1AUkK 6Mc7cOZbSVZIRqw+CmtB1hSgyABtUq1gHnRGJcLdnQbYi4jjxwj2cPSuXH7TqkmBAmdT ajdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:cc:to:from:date:references :in-reply-to:message-id:mime-version:user-agent:dkim-signature :dkim-signature; bh=FDGxDXPN2SUWSByp360DMt/uwwjigIPj7nZHao0b4BQ=; b=N4viy0awOHHjqaNYJpBMT5JvbGfQWNcgfrearLVyOY2CrLu74OERnjN/0d+5bCo6do Pe8ytnwlt9Km7+Hw+VHVs+z+OVn0WaWkGkriIhb/3mcnJFkB8TVwTIItF0WWQYdIWC5l qUScKYvrA8/RrXEvqL6+VdrmfYcrvoHeW3PJ3Lfrrqcsb7iREwhYbDCyDVnYXkSGAmB5 zImMpUji550f6LtmM69jznPBPS/GWHXrmufchtIOgPRgGlnmOCvaKOl8m4s2wzpSAuD9 0oiG6OZFPu1tF+XwOgR7tbdJ/bLC8YA+sVFpJaQJa2eBF8Dn8SYYgpVqTSTSFhUqMYOu gR9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@dxuuu.xyz header.s=fm1 header.b=GvjdEwV3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=yEXkWiFl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l1si58236868pgs.458.2019.08.09.14.51.34; Fri, 09 Aug 2019 14:51:50 -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=@dxuuu.xyz header.s=fm1 header.b=GvjdEwV3; dkim=pass header.i=@messagingengine.com header.s=fm3 header.b=yEXkWiFl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbfHIVux (ORCPT + 99 others); Fri, 9 Aug 2019 17:50:53 -0400 Received: from new1-smtp.messagingengine.com ([66.111.4.221]:55411 "EHLO new1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbfHIVux (ORCPT ); Fri, 9 Aug 2019 17:50:53 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 0FBA6217F; Fri, 9 Aug 2019 17:50:52 -0400 (EDT) Received: from imap36 ([10.202.2.86]) by compute4.internal (MEProxy); Fri, 09 Aug 2019 17:50:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dxuuu.xyz; h= mime-version:message-id:in-reply-to:references:date:from:to:cc :subject:content-type; s=fm1; bh=FDGxDXPN2SUWSByp360DMt/uwwjigIP j7nZHao0b4BQ=; b=GvjdEwV3qRM4CESVG0xWRLWI+29GB62ehpRrK+x3nuOIi5a mHPCzGYWfwN9TkAsQZ4XvUZTaStNK1mv36vHvcjITLHY0LlsZAZeVDUjok8o/oQq y0rH4YITtaQ/mrv8oLnsqUIRKb3k8YkCjsxsG8WolCtNo08JfH0XUE+OeT9mZz4j R8eqbSyrUG1uIbJ5tY/kZC7wtOwGZZJ//Eplln7vVIOLKK2H8q2V6zesXW0NbYRI dlbfRjM7CJEdnhEeom2oqjZKAmplN+TzBfvqQ5pOcfmNz9SykzWEeDhlG3ksvroG gMn917unXh3lkwxOyWsu7lvZScEp9eQr7D1kQAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=FDGxDX PN2SUWSByp360DMt/uwwjigIPj7nZHao0b4BQ=; b=yEXkWiFliuHufd+e/NWJ+C Kq+eZ7OyUsY+ojUw77LB/IztX4BmPuyQcTpILsfqoGEIxhm+sk6o/F/Tl1mzkkoh +FwcV0KLTwWY2Pq1o2oQJg1myRpD2wJJ4SRgJI8InfpoX2yKLwFXYbH9PnYAaX6f AOMlPq3LmQYN/6M5k3IbUZ7tcl5Toao71ahIat/ZawnoTyMUI5Q/Q1bjGJnyc44a B+hl5u2aTXTVdb/NRBFvdsHBs15EDzYHW9JxMt9+o/srORGBb2ARlKoMt3Ec09Rt 8Yt5Y7UBL3hHmo/Y0BLyxrrLLwYAhKXfkF66u6QH7/8boKblqXH6ZSD6575/ZDvg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddruddukedgtdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdlfeehmdenucfjughrpefofgggkfgjfhffhffvufgtsehttdertder reejnecuhfhrohhmpedfffgrnhhivghlucgiuhdfuceougiguhesugiguhhuuhdrgiihii eqnecurfgrrhgrmhepmhgrihhlfhhrohhmpegugihusegugihuuhhurdighiiinecuvehl uhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0446B12200A2; Fri, 9 Aug 2019 17:50:48 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.1.6-809-g8e5c451-fmstable-20190809v1 Mime-Version: 1.0 Message-Id: <3429be0c-1a10-452e-a566-bf02db72f5ba@www.fastmail.com> In-Reply-To: <20190809214642.12078-1-dxu@dxuuu.xyz> References: <20190809214642.12078-1-dxu@dxuuu.xyz> Date: Fri, 09 Aug 2019 14:50:47 -0700 From: "Daniel Xu" To: "Song Liu" , "Yonghong Song" , "Andrii Nakryiko" , peterz@infradead.org, mingo@redhat.com, acme@kernel.org Cc: ast@fb.com, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org Subject: =?UTF-8?Q?Re:_[PATCH_v2_bpf-next_0/4]_tracing/probe:_Add_PERF=5FEVENT=5F?= =?UTF-8?Q?IOC=5FQUERY=5FPROBE?= Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 9, 2019, at 2:47 PM, Daniel Xu wrote: > It's useful to know [uk]probe's nmissed and nhit stats. For example with > tracing tools, it's important to know when events may have been lost. > debugfs currently exposes a control file to get this information, but > it is not compatible with probes registered with the perf API. > > While bpf programs may be able to manually count nhit, there is no way > to gather nmissed. In other words, it is currently not possible to > retrieve information about FD-based probes. > > This patch adds a new ioctl that lets users query nmissed (as well as > nhit for completeness). We currently only add support for [uk]probes > but leave the possibility open for other probes like tracepoint. > > v1 -> v2: > - More descriptive cover letter > - Make API more generic and support uprobes as well > - Use casters/getters for libbpf instead of single getter > - Fix typos > - Remove size field from ioctl struct > - Split out libbpf.h sync to tools dir to separate commit > > Daniel Xu (4): > tracing/probe: Add PERF_EVENT_IOC_QUERY_PROBE ioctl > libbpf: Add helpers to extract perf fd from bpf_link > tracing/probe: Sync perf_event.h to tools > tracing/probe: Add self test for PERF_EVENT_IOC_QUERY_PROBE > > include/linux/trace_events.h | 12 +++ > include/uapi/linux/perf_event.h | 19 ++++ > kernel/events/core.c | 20 ++++ > kernel/trace/trace_kprobe.c | 23 ++++ > kernel/trace/trace_uprobe.c | 23 ++++ > tools/include/uapi/linux/perf_event.h | 19 ++++ > tools/lib/bpf/libbpf.c | 19 ++++ > tools/lib/bpf/libbpf.h | 8 ++ > tools/lib/bpf/libbpf.map | 6 ++ > .../selftests/bpf/prog_tests/attach_probe.c | 102 ++++++++++++++++++ > 10 files changed, 251 insertions(+) > > -- > 2.20.1 > > CC PeterZ, whose email I misspelled. Apologies. Daniel