Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5084287imu; Tue, 8 Jan 2019 11:11:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN6PfosgcQL8/ipO6u3xZkIkgxdE/pKc9odN4HzbgGuF9CJzRM59N+ELoji6m+YI8StrOL3n X-Received: by 2002:a17:902:9a07:: with SMTP id v7mr2876231plp.247.1546974690503; Tue, 08 Jan 2019 11:11:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546974690; cv=none; d=google.com; s=arc-20160816; b=KdniQFw3+tTiJSrZeEGJBCte7z2T5dsGbk5LRc/M9wL6hdh25Vd6wy89J2nBqrHpU4 5BVVXzwmGiuK4pLANCp0cvpdXn9S8BxwciBrZyvL3LzF5btuSCgbPbVkA6z5ruH3MyEC DaRK6wNYT012sHJkS+bxZEPQI9gI0Abos+rzo7GssKzj9q/C7uSVmmSTuka6u6NzJtxO /zJP4VKnJ7fBI1kfhzZzgK75tyI0pwaB4zRzKCfrCd+NK9fQzsYzyEVaHHitRLODouDK +xay/QOxb4fzrtrDYH97nTE3vA2QqlCfG1XrHvx+b+sfQxw3c4k2XIcazsi53MR5Pc+u cEXw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=UUOYjxSe1goPIEiXn1EOgrZmjCE8fiHJVtC1q2z0pSY=; b=nVQY2RCege8AJ214JPMcMQzYVVhCKOQsEv7QFQVTReDuxUoYtqLeFAJ5mm60SegLam mvLdMhx/u2HcMKDnLpE+F7GOcB0NkPItnA22zy2PpnoRlQ9pGt4jyjdn/HwKA6AB2w0E YfQAo9E75Pw6Lj7pdVs9ODglfR25e3RBYJFSJ/FE3M9OZizBZANp1wh7MNtwsNAeulRl C6OkghRArrAbsQJUa01ALXRHz3A/Wg5+KhkhE25cTgnJ3T/IIvOsngn6rEBsjVf9Lx7/ e9TDAH7fQUjjOdIxQmxvxpIg+XHLQh+OI8TizNyvEORDZxV3tBZX9KU/HaGWf/uW6s5q u18w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="m1g8T/hU"; 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 e126si15846433pfh.185.2019.01.08.11.11.14; Tue, 08 Jan 2019 11:11:30 -0800 (PST) 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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b="m1g8T/hU"; 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 S1729504AbfAHSbe (ORCPT + 99 others); Tue, 8 Jan 2019 13:31:34 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:40554 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728752AbfAHSbd (ORCPT ); Tue, 8 Jan 2019 13:31:33 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=UUOYjxSe1goPIEiXn1EOgrZmjCE8fiHJVtC1q2z0pSY=; b=m1g8T/hUZ9alnmvH/6/uhv098 sxPGI2ne6ecZwcfl+Uj6+GHZ4u4UYlJ38kpbn0exf0SYR6p0wfD26BWd/AwVDeqROyTD44YbnKeO7 fSwCRXFCliyCN24bSH3IBTkeYPUEEuIvpWKy4aVvvpfNxpW/SiS8ICOTS4jLLCJ5oa4YiBcjEZPJW sf7tFQn2aLoDbWsCZ+Mho1rsLxkdsMdUoC1rJGLEfZ9eoZi81k+eQ0Vdgg/y3NWXAOznYDoalsGKC AIuwZAxMJuhGEJb9dvXo5LTIs8r23WH+mQBbGGqffZBmjrWbuOUz/oQbOIJF/m5rH0aOwIX41rfR9 25LrD1QVA==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by bombadil.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1ggw9y-0001ZF-Iv; Tue, 08 Jan 2019 18:31:30 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id EB382202943F4; Tue, 8 Jan 2019 19:31:27 +0100 (CET) Date: Tue, 8 Jan 2019 19:31:27 +0100 From: Peter Zijlstra To: Song Liu Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, acme@kernel.org, ast@kernel.org, daniel@iogearbox.net, kernel-team@fb.com Subject: Re: [PATCH v5 perf, bpf-next 1/7] perf, bpf: Introduce PERF_RECORD_KSYMBOL Message-ID: <20190108183127.GB30894@hirez.programming.kicks-ass.net> References: <20181220182904.4193196-1-songliubraving@fb.com> <20181220182904.4193196-2-songliubraving@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181220182904.4193196-2-songliubraving@fb.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 20, 2018 at 10:28:58AM -0800, Song Liu wrote: > @@ -648,11 +649,18 @@ struct perf_event_mmap_page { > * PERF_RECORD_MISC_COMM_EXEC - PERF_RECORD_COMM event > * PERF_RECORD_MISC_FORK_EXEC - PERF_RECORD_FORK event (perf internal) > * PERF_RECORD_MISC_SWITCH_OUT - PERF_RECORD_SWITCH* events > + * PERF_RECORD_MISC_KSYMBOL_* - PERF_RECORD_KSYMBOL event > */ > #define PERF_RECORD_MISC_MMAP_DATA (1 << 13) > #define PERF_RECORD_MISC_COMM_EXEC (1 << 13) > #define PERF_RECORD_MISC_FORK_EXEC (1 << 13) > #define PERF_RECORD_MISC_SWITCH_OUT (1 << 13) > + > +#define PERF_RECORD_MISC_KSYMBOL_UNREGISTER (1 << 3) > +#define PERF_RECORD_MISC_KSYMBOL_TYPE_MASK (7 << 4) > +#define PERF_RECORD_MISC_KSYMBOL_TYPE_UNKNOWN (0 << 4) > +#define PERF_RECORD_MISC_KSYMBOL_TYPE_BPF (1 << 4) So this gives us 8 possible types, of which 2 are claimed. I suppose we already know of FTRACE_TRAMPOLINE and MODULE, which accounts for half the space. > + > /* > * These PERF_RECORD_MISC_* flags below are safely reused > * for the following events: > @@ -965,6 +973,19 @@ enum perf_event_type { > */ > PERF_RECORD_NAMESPACES = 16, > > + /* > + * Record ksymbol register/unregister events: > + * > + * struct { > + * struct perf_event_header header; > + * u64 addr; > + * u64 len; > + * char name[]; > + * struct sample_id sample_id; > + * }; > + */ > + PERF_RECORD_KSYMBOL = 17, Do we really need u64 length? That is, are we willing to consider symbols larger than 4G ? Could we not reclaim the top 32 or 16 bits thereof for that type thing instead of using a few misc bits?