Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp6400139ybv; Wed, 12 Feb 2020 11:28:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwBn59JyU3u3WUkPmQ/m35tUOX0+3ZJ5ahL/9Dbhk5WX460DlSO+60bxv708eTbG3Xr4FOE X-Received: by 2002:aca:d4c1:: with SMTP id l184mr441837oig.172.1581535681965; Wed, 12 Feb 2020 11:28:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581535681; cv=none; d=google.com; s=arc-20160816; b=myt4LFmblq12RtaxLtQoLFBvTRFusRquP2O5PnMCiK0SqPL0n+eVX0oVSzRK7xucDc iU04ZAdw399vTzcRcC1s84+ZMdzUsXEtNmHw8pm0pHTMLT+rNK06XmR2Sv2Xd3whpbnw ZBhXWw0hPrB0OvYVxB2SlNn5Yx1TwED6HWGx29JhMPrK5S4cFU+8vfqCt5c7m3ALPA+R XyhKVQB6fTY/fcaSulQlIKKhEKFW+z24G78+EkKeMTbEeogJ+SCj2x5vl3pd3DoDeFej zZkasNrKxnwNvyozcARBV6SddszFAg/e/jqI7eTYilCBkcyiEV2K0+gjwfXlSjyXUuYw pN3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=L+NwtiOn+7IEAksmkohPg1lo6ZNmjobcpFN4LYw+c1A=; b=Q5NglJnKyue51W+e3vJgfkBctefO2FphvFMOZFq1mEwwXwvBzid9t2UDL9NQoTMY8y Cz4w+I+PrBNXu6dS9HzrF9rqQdOU0maT6PcucdoyPodheZOad3mHha4aHosW2hRLhRmI mcG1G+/to/ZT0BqCAA7HSdhBs4ZxJDYqNqksXDF1EzhYLdygyMB+x6sFIb7rAe3+j4wA G3nyAXgcsV9WRXXMe8NpgWaBMe/wQFPoMQg9CogA1D81snbXZOMQfzyeJ9/XHHu1IZRd i4Gmtur5PIY/Q8jLYmWEEhz5USPjxuExH/FWAJIpF4qwZPspim68FN/YiOZgQPTvVnS5 Nx9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Qusge0Cd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v23si612003oto.81.2020.02.12.11.27.49; Wed, 12 Feb 2020 11:28:01 -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=pass header.i=@google.com header.s=20161025 header.b=Qusge0Cd; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbgBLT0X (ORCPT + 99 others); Wed, 12 Feb 2020 14:26:23 -0500 Received: from mail-lf1-f66.google.com ([209.85.167.66]:36290 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727361AbgBLT0W (ORCPT ); Wed, 12 Feb 2020 14:26:22 -0500 Received: by mail-lf1-f66.google.com with SMTP id f24so2440806lfh.3 for ; Wed, 12 Feb 2020 11:26:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=L+NwtiOn+7IEAksmkohPg1lo6ZNmjobcpFN4LYw+c1A=; b=Qusge0CduME+HsZhT7UI7HXe8guM/LKvxaGQbvPHB0srVUm4oMrhSXJWwk+jEyAixP kKkBLFYZNKtICBu3ZqdVZB0C572i9fcM/wgFmd0PbdxqmYHA11TsFe7j7rCKm3mWR7fi 78T1GBus6srA+xxrBW5KNOSKSkBRPhzyAfmQvCahhU/7u07fxaDSvx8s4RdJfP7DpBiG U63VUZH43LEjseAsp6cpvGdSJnXuYRZge3vjNPPq6n7BAo9o2WESTXehOphryaRtXLM/ 0pcJrAnf9SADma4z10iz+1GIs1w9CuGfZOWefIqqTmZO9SYC2wLeheKHN1qzq5WOGYeH tfOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=L+NwtiOn+7IEAksmkohPg1lo6ZNmjobcpFN4LYw+c1A=; b=gTNkTsJjKIXb2XlzC480YOoR6Bl0q1ype1N64Rfp4Q4hI13o/NXo/B6dek7Q3chYL5 H7E8ONvr3+gfjdZe+V7ivBK8N3nn58ZcgE0NJnIQ2+ujRKj95OUieNoL+wQ0vecTi/7/ gOqvoxLVJLZ3ihSjIv7FyHqa64EHoM+F4Jc/DS1w9bAzT09U5/ID72CMF5INpxlIdNAv xJCcDU/h77NdL5RMLaR+T1uK47MC5d5vqawonjbKS4/wSRp7KWBbkNLPbrLCjMW3wUWk 9sdGWc6D//SePMwx0nmqEbj3HrQjrcKm36f/kixySRinq10A8QufjthTQ40wEQMzq+1u 9MPA== X-Gm-Message-State: APjAAAXzhboL/4fkKyuE1bjcRXMCitjewnUvUVDJKhte8sc/y2C96N4X AbvPjJgBNCx3z3SSutv5PaFqTR+qTNHVZyFheqgk X-Received: by 2002:ac2:47ec:: with SMTP id b12mr7463103lfp.162.1581535580425; Wed, 12 Feb 2020 11:26:20 -0800 (PST) MIME-Version: 1.0 References: <20200211011631.7619-1-zzyiwei@google.com> <20200210211951.1633c7d0@rorschach.local.home> <20200210221521.59928416@rorschach.local.home> In-Reply-To: <20200210221521.59928416@rorschach.local.home> From: Yiwei Zhang Date: Wed, 12 Feb 2020 11:26:08 -0800 Message-ID: Subject: Re: [PATCH] Add gpu memory tracepoints To: Steven Rostedt Cc: mingo@redhat.com, linux-kernel@vger.kernel.org, Prahlad Kilambi , Joel Fernandes , android-kernel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Steven, I can move the stuff out from the kernel/trace. Then can we still leave include/trace/events/gpu_mem.h where it is right now? Or do we have to move that out as well? Because we would need a non-drm common header place for the tracepoint so that downstream drivers can find the tracepoint definition. Best, Yiwei On Mon, Feb 10, 2020 at 7:15 PM Steven Rostedt wrote: > > On Mon, 10 Feb 2020 19:05:35 -0800 > Yiwei Zhang wrote: > > > Thanks for the prompt reply! > > > > The tracepoint proposed here is for tracking global gpu memory usage > > total counter and per-process gpu memory usage total counter. The > > tracepoint is for gfx drivers who have implemented gpu memory tracking > > system. The tracepoint expects the de-duplication of the shared memory > > is done inside the tracking system. > > > > On Android, the graphics driver has implemented gpu memory tracking. > > First, we'd like to profiler GPU memory with this tracepoint. Second, > > we implement eBPF programs and attach to this tracepoint for tracking > > GPU memory at runtime on production devices. However, the tracepoint + > > eBPF approach requires the tracepoint to be upstreamed so that it's > > considered a stable interface which Android common kernel can carry it > > forever. > > > Then it needs to live in the drivers/gpu directory. kernel/trace is for > tracing infrastructure and not for adding trace points. > > -- Steve