Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4425751ybv; Mon, 10 Feb 2020 19:20:01 -0800 (PST) X-Google-Smtp-Source: APXvYqylpQlCTfLpL2MRJjgbGBAaSgnDXMWNCZ86TQHBwSWoDr4bCH2pbDngHhelYWdZKf5M6stZ X-Received: by 2002:a9d:6f07:: with SMTP id n7mr3509461otq.112.1581391201236; Mon, 10 Feb 2020 19:20:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581391201; cv=none; d=google.com; s=arc-20160816; b=oVUVjuoMeLV1dlbwU0w19okVt9MFFppFatVSkoZSEiQs6ia0FwrvsqfnZelM01ETKh guK2d2psh8M4Mjtn1Zt8tpfupGF/V5SEB9AmwMDVPFcyP74NMOMcTEnB9ju9ucApozpz gewZJGMNm4y3LWfgR7Gj+y5OOY91jZF1eAqaZkppWS6KPyO2ngBEGjfdXR+plnZJ2b4b SvcpYX9drgaVTLCd3efHSPssUEikxN3K81Nbf1ccwRKSiwD1ZTEdjqS+FPhL1M3/lS1U 33JbmEusMXV0V9MoanMfsMMzIT8RslhiQ9asPMEKYeTyBtaG0Gj+VqqzRlH1BUFRDYgI Ve0g== 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=Rn1p5/lbII7V0l1DMSGRcwSDsU+MJEO/butD3aVJNuA=; b=YNgaHjhTjDTlImcxfRgK2EzwcjltS/SmjuV81QcuM7wigZvY/Lz8LKuvJ7vFfh4RSy ORC8RaqjmZtTO5E0M6cpJgq3SYVxLFKWFvJF1sTUYSEe/v8GJ/Uu0d4e+CclFCIbYq00 Sqp1SnKF9copnLhThBQqKxR3OmRECn4ni9nKShSk8MXDBN8NH2vmr8YgL1gk/zLfZaOM V9DUGasluBAlALQhkS0duPvaTsSSRe5eFizdfZR85EyNgg1qJTIWwbNX+Zf9Z82lrN00 vgQ4S2XOgE+++P0/CQ/vyov9oR6RimNleDrWEZbf0PAp4aS7Jbgx7aR0f4w8eben1ctX w5QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=guum6PPt; 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 y8si1170753otg.309.2020.02.10.19.19.49; Mon, 10 Feb 2020 19:20: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=guum6PPt; 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 S1727991AbgBKDFu (ORCPT + 99 others); Mon, 10 Feb 2020 22:05:50 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:45863 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727984AbgBKDFu (ORCPT ); Mon, 10 Feb 2020 22:05:50 -0500 Received: by mail-lj1-f193.google.com with SMTP id f25so9808715ljg.12 for ; Mon, 10 Feb 2020 19:05:47 -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=Rn1p5/lbII7V0l1DMSGRcwSDsU+MJEO/butD3aVJNuA=; b=guum6PPtD1iOwa4ooNUwqPjTFmwIQ/xQ0faz2TiBp0KPQrQF3UVcefGkxRbeVYiINs +YVKuygMkTJOncncS3155kQZ5zBIubwY+m25rmuIoWWFTvQzsqEo9JpMRJgI0cQB4pmu BI2urrkfveF0K4daq5C/lEvwag4nCZ1ESATAZt4hOHNdhEOE1uXAMworr0DpI8ddVw8+ RFBTaIN2ArCVMxfcKaCD64VVOd/GcUX8teHiAseOHT4rqMBoKlFW30VLyOZTn7gygkv/ Fy6ix+B8Ar7lFjrIv5Fbr561bSKf6fsPjJ0lH/2lM/lJu8UdqPqA0jAuIBOqFTJniVvK gMeA== 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=Rn1p5/lbII7V0l1DMSGRcwSDsU+MJEO/butD3aVJNuA=; b=hvsbOF/Ntuxo2OSkJJRC8e1gxaNAY9naAk+CwHyez76RD/7RGsH2kALiZfo2quRf57 MpILsGcnQpJi/ApN7ds7gD0+7WPvjGJvu3ZVdiBzk9e83mDxTlKZLAxQMFSCQ52S+VJi FSzyXdtDdOI9hSPHEdjvRCUNy1SgmkxpmGpUEsGSOe6mFfoUQ4ZRS5Yiu8TWaCrKv7Aj LoK24kQZpD4vCKDkxn7rX+UymgCwqclBDEEjaNfedz4q9vTEmeORh3/G2pOHVsehohJd ZoMiW9cTZrrNFxkFaXEwergN/FNCBGN8gYuILU+HJv6BURMgLpd3mezZlS2sg7SWZDiK ekBQ== X-Gm-Message-State: APjAAAUySg0+HcDUy9oWU1qewg6Ejle4N4u73nb3z7JRCYdD7rcBQv+d lApn2PshoH8E/KzBW312nLH7ti42xgFLKrkw+wL/ X-Received: by 2002:a2e:9157:: with SMTP id q23mr2788619ljg.196.1581390346310; Mon, 10 Feb 2020 19:05:46 -0800 (PST) MIME-Version: 1.0 References: <20200211011631.7619-1-zzyiwei@google.com> <20200210211951.1633c7d0@rorschach.local.home> In-Reply-To: <20200210211951.1633c7d0@rorschach.local.home> From: Yiwei Zhang Date: Mon, 10 Feb 2020 19:05:35 -0800 Message-ID: Subject: Re: [PATCH] Add gpu memory tracepoints To: Steven Rostedt Cc: mingo@redhat.com, linux-kernel@vger.kernel.org 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 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. Best, Yiwei On Mon, Feb 10, 2020 at 6:19 PM Steven Rostedt wrote: > > On Mon, 10 Feb 2020 17:16:31 -0800 > zzyiwei@google.com wrote: > > > From: Yiwei Zhang > > > > This change adds the below gpu memory tracepoint: > > gpu_mem/gpu_mem_total: track global or process gpu memory total counters > > > > Signed-off-by: Yiwei Zhang > > --- > > include/trace/events/gpu_mem.h | 64 ++++++++++++++++++++++++++++++++++ > > kernel/trace/Kconfig | 3 ++ > > kernel/trace/Makefile | 1 + > > kernel/trace/trace_gpu_mem.c | 13 +++++++ > > 4 files changed, 81 insertions(+) > > create mode 100644 include/trace/events/gpu_mem.h > > create mode 100644 kernel/trace/trace_gpu_mem.c > > What exactly is this, and why is it being put in the tracing > infrastructure code? > > -- Steve