Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp476794pxa; Wed, 12 Aug 2020 06:53:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsVrA/v2QJLkJUmc/rcNm4DkmIp2YlXQRIX6jpd3oO3dd52qsFLKtrIeZdrq5DAjsedCb2 X-Received: by 2002:aa7:cb45:: with SMTP id w5mr30849012edt.77.1597240419667; Wed, 12 Aug 2020 06:53:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597240419; cv=none; d=google.com; s=arc-20160816; b=XualHtNMyxx6PLtmBS0LCgGd7QkzYh8W8Pv5wDMQGIEFivlYAyLBEV6F7Aejmy8XtD dmyhFB/J+of/SHoLpivT7fpoTk1qUEjBxyxih0+fxguH/PK6bPaU3ErMGV5oVKM3DxEC fGHEY8m79yOyhs+yUE1roRk+QHjPySwZo7jfsoihcZ6XdOnySaq3D06o0iANMONwyY7j 7qXRUyKmNAVL/GwxXJY6RQ5ffXUDDdnIYp6DB59mJF+Vsry0utZHNOM07xn2WcS1+1xr Efx0jAqkljqf7TD3d0dmOhrJxzQlZA+u0rOhH4BF1RwIawTA0m+8g91EGhXQHS3cxLWQ GcqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=6p588ldpfa1PVpJ16iQTZFtp7YHBAN7hgleJ+hPyMLw=; b=UeHyS2V5W0MuV7Q1ESce4APhmSiNfO7HvJZcqGl8U6kXNzHsSAjlsSirwcinFjscF2 anTcvvrdOsHkPyRLIJSx0b8f2Hr49y6xbl7G7rc6AI6/ct+jU8EqBQnebFNO/RhzwgGW a2wxqETVLVOoZQuN5LQXZ0Ik9rff2VN00OKERmAhLwiJLM13hOEWTdH5S4XqqDZE8MH4 on1b/8BUR2E5f3JVmD2ARU5kDgbl+q5in8xraXsMW/7L5sDOf344qyDuu/m7bWNhW9gO 8ljpSmcZEy5212olnEz1DTMORFAyUkDG03bj9e1dJiXzbBpyG+2a57KnEpsBLKNgYepv SWiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Aof0WnwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p62si1378072edb.9.2020.08.12.06.53.16; Wed, 12 Aug 2020 06:53:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=Aof0WnwL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727854AbgHLNth (ORCPT + 99 others); Wed, 12 Aug 2020 09:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726804AbgHLNtf (ORCPT ); Wed, 12 Aug 2020 09:49:35 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A943C061383 for ; Wed, 12 Aug 2020 06:49:34 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id r21so1937311ota.10 for ; Wed, 12 Aug 2020 06:49:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=6p588ldpfa1PVpJ16iQTZFtp7YHBAN7hgleJ+hPyMLw=; b=Aof0WnwL4Zpy/TzlXE9WxgzQzSIBn9eQBLvK3uaFdobVRSFA6hoRM5PP9kBt33r8D2 lUkSV5tiTUP0ENvEe+exQdP2uazJOa6dDn/xLZES9iVUFHXzn1wKBT8sSRou9DXjSvgN rCHCsdVGAFiBdxpYbmuqYBeZCtvokMeYDr+lQ= 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:content-transfer-encoding; bh=6p588ldpfa1PVpJ16iQTZFtp7YHBAN7hgleJ+hPyMLw=; b=SVDLaxyzM2Aftio1vLNdJf5gv36CFxqv+VlTP6xKlgV53ILfdjNIgHxuW2HTHb/4df KRyJlbE2dMdGSWB5HmVPmm+pfc2UchEIEtaW+fXH7gBrvA/ko4s7zpeIknMIO804kJFm FSDs2sFefXqgEyoLFVmBTFJ9J6xrb5fOrwJUCPfWmxaRQHuecxmvjReUp4wYmzZI3epS CV7Zt67hKURuKaWNRb7C8lUeL/egWC9CYuCfL8bPojnfB0NOa5RT6nIw7SP0f/nmnele H1IfAPInPFO8sKGonwM0cxtbcg7f6tzfgaM8K3AFzZu36Cqo2weID0yMTZG0slkg09DW +jrg== X-Gm-Message-State: AOAM533xwJqIo8e6SaL7DU4B0uldxTb0j+dIgpyV0cNlPGgeMnBTn3d0 EZ9rbeLdUa+zzc7jmps6Xwyq4gqc2cTJxqNZcsNOHQ== X-Received: by 2002:a9d:7283:: with SMTP id t3mr8920536otj.303.1597240174269; Wed, 12 Aug 2020 06:49:34 -0700 (PDT) MIME-Version: 1.0 References: <20200807133658.1866-1-christian.koenig@amd.com> <1975d7d1-8f94-5852-6ccc-19fde4d4a919@gmail.com> In-Reply-To: <1975d7d1-8f94-5852-6ccc-19fde4d4a919@gmail.com> From: Daniel Vetter Date: Wed, 12 Aug 2020 15:49:23 +0200 Message-ID: Subject: Re: RFC: How to adjust the trace pid? To: =?UTF-8?Q?Christian_K=C3=B6nig?= Cc: amd-gfx list , dri-devel , Linux Kernel Mailing List , Dave Airlie , Shashank.Sharma@amd.com, Alex Deucher Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 12, 2020 at 3:42 PM Christian K=C3=B6nig wrote: > > Ping? Daniel, Dave any opinion on this? Type patch, cc: tracing people, see what they say? tbh I have no idea, but they have been making unhappy noises about some of the tricks we've played in the past in i915 tracepoints. So not everything is cool in there. Otherwise I guess just add another tracepoint parameter to dump the correct userspace mm. 3rd option could be to dump the current mm (since I'm assuming those threads do kthread_use/unuse_mm to impersonate the right userspace process correctly) in the tracepoint infrastructure too? Cheers, Daniel > Christian. > > Am 07.08.20 um 15:36 schrieb Christian K=C3=B6nig: > > Hi everybody, > > > > in amdgpu we got the following issue which I'm seeking advise how to cl= eanly handle it. > > > > We have a bunch of trace points which are related to the VM subsystem a= nd executed in either a work item, kthread or foreign process context. > > > > Now tracing the pid of the context which we are executing in is not rea= lly that useful, so I'm wondering if we could just overwrite the pid record= ed in the trace entry? > > > > The following patch does exactly that for the vm_grab_id() trace point,= but I'm not 100% sure if that is legal or not. > > > > Any ideas? Comments? > > > > Thanks, > > Christian. > > > > > --=20 Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch