Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp490743pxa; Wed, 12 Aug 2020 07:09:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyT09Bp2x+FMtnrrjjb95fB/uApIele/b/3HSSuBvHUXWK1npiLsCO9TTJrKEnR+vE+a0gH X-Received: by 2002:a05:6402:1643:: with SMTP id s3mr61024edx.185.1597241355959; Wed, 12 Aug 2020 07:09:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597241355; cv=none; d=google.com; s=arc-20160816; b=QbuVTYIQpW1PZO7ZHQzdE4t1jM+cIeQ8Sage40azzLyQIeymAPdeT/3lxfRKtn46tA tJ6H2u2zhZ9dmauHc1RS1ybg2PzcWBZV7/ZA19kuroVre+3LXXQvVePqxcSkGzNPV1HM p7QG+QES/IVIMZvoqLd8S0od5S/Q97XQGCfXzm0Xs1Mn8m//mkbtydP4zyLdGKxJoM01 zBHsejrIxYk43QFnyGNUnxQ2LB09rFwTil7KdhPGn8TIh1RZ/4xZrPLwyoRSMqcsKLQ3 t60UkoHpIFDDro62DomRwY85H/ULeg55zcSvaWYVUGDQOoSDPPykAZMroG0lmqYNMfmQ bjog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to:dkim-signature; bh=d8f3pH5/ZCKSKStfszgIlZxnw3uyn/996p8sG8HyjxQ=; b=QlJP9iZeExZZEonBwrPZRo8szKaeTd2uRd22/FcPXg/k9vQobHCiSlkNB6lVcZ1hr/ CbljvaX7cRd8D/w4c854zMGEGFPmTjOQU0hZlNDfnCJjmuL0R5nZo7obJIgZv7sXYVEA PtzkyPoZdAOLHsxYbIK1+gp6D8f1pGr3NWLIFt+LuGO58WDiNlgG8rs/MmSCYZcu+kPf eoXu0IkYDRQUwG37CuJBPYhEZltCXVGHyezj9l1CXr41VIRC8V0TiHT4BSvZDNQqVisg Ehv23xHB8REAP010bbcKnATAwQ8rUkYWCT+g5aztchtSG2eBTUZgd9/B94MKRikwbKmq LDVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="fAR/xXia"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p21si1464324eds.379.2020.08.12.07.08.51; Wed, 12 Aug 2020 07:09:15 -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=@gmail.com header.s=20161025 header.b="fAR/xXia"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726543AbgHLOGd (ORCPT + 99 others); Wed, 12 Aug 2020 10:06:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42992 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgHLOGb (ORCPT ); Wed, 12 Aug 2020 10:06:31 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 31533C061383 for ; Wed, 12 Aug 2020 07:06:31 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id c16so2386984ejx.12 for ; Wed, 12 Aug 2020 07:06:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=reply-to:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=d8f3pH5/ZCKSKStfszgIlZxnw3uyn/996p8sG8HyjxQ=; b=fAR/xXiaC+iP55fNn6oDuokITntCFEBi1xlzqIOiXdpufTT+WXrxe16rF8df2MiHZY er7UtqFH2MHRU7xYYD1IApTAK7fdlpfxic9pzjkwK5cY5cYUmVOs2zgzIvB8c+XvSiZR 3L25GBDd93gJK37iUq3pqEhk5NLOUD9oT6bLhsIDtTdX/ne0Yg0xt9gS1NnFCxJxEQIB sskLpOZFE0XZFdBoFghrvl7obOn7ywiRYPOrKLFwLku3v746zDYlZPGdpOyW7kwQ8mQJ Wf8ihmeQWtY7mcxKWzJxDDH4F7cARHazoA3nwmdj5ULhEOfNu4ehVklCkuUeqEuOJ+vS FrZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :message-id:date:user-agent:mime-version:in-reply-to :content-transfer-encoding:content-language; bh=d8f3pH5/ZCKSKStfszgIlZxnw3uyn/996p8sG8HyjxQ=; b=QhcNxbthTpdmDFQI5NhlO2dJYxZ/wvO3Zetmpo9pMmejDnHhiuGH9E4aBQqA8TA+vC rie70W92xZCAvAszst3yBHItEQ8zucvoNEEZDBpVZFvqwUJiHEG/FkaAqOpjsEDPc8Bc l+xZffSP4Q4Or5LFiMNGjmP8Ivsk2llMY8Fs4wbkS11BH42W6KMCogj9zP91Z7WHYZvg NHlcnv2G3MJbxBx2fCi4OYQn5GzX1NxXDPZJLF0TUmnPvd83TcKAY1B5T/BrZKjUoNvJ dW2E48D1IFvyDzhLhDEr8qno8TOurgbzny3fMWX6VEds5BytzOjF5pdsYo8HZPPF9BiW w0NQ== X-Gm-Message-State: AOAM531RAyIHEImDJh1HuotESyhPj5wTSM5mGTk89qrLeEJzOXlOVQp0 67VqKeZ7lDo9c7U/M7jrijs= X-Received: by 2002:a17:906:140e:: with SMTP id p14mr31966727ejc.430.1597241189936; Wed, 12 Aug 2020 07:06:29 -0700 (PDT) Received: from ?IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7? ([2a02:908:1252:fb60:be8a:bd56:1f94:86e7]) by smtp.gmail.com with ESMTPSA id gl20sm1674979ejb.86.2020.08.12.07.06.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2020 07:06:28 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: RFC: How to adjust the trace pid? To: Daniel Vetter , Ingo Molnar , Steven Rostedt Cc: amd-gfx list , dri-devel , Linux Kernel Mailing List , Dave Airlie , Shashank.Sharma@amd.com, Alex Deucher References: <20200807133658.1866-1-christian.koenig@amd.com> <1975d7d1-8f94-5852-6ccc-19fde4d4a919@gmail.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Wed, 12 Aug 2020 16:06:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 12.08.20 um 15:49 schrieb Daniel Vetter: > On Wed, Aug 12, 2020 at 3:42 PM Christian König > wrote: >> Ping? Daniel, Dave any opinion on this? > Type patch, cc: tracing people, see what they say? Adding Ingo and Steven then. > 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. Well that was the feedback I was looking for. > Otherwise I guess just add another tracepoint parameter to dump the > correct userspace mm. Well the tracing subsystem looks like rather complicated macro magic, so I'm not touching that before speaking to he maintainer what approach we should take. > 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? Nope, we don't use kthread_use/unuse_mm since we don't touch the process which initiated the operation in any way. This is just to improve debugging since it doesn't make much sense to trace the pid of the worker thread. And since we have the pid of the initiator around anyway using it should be trivial. Question is rather how to do it correctly? I couldn't find much precedence for this. Thanks, Christian. > > Cheers, Daniel > >> Christian. >> >> Am 07.08.20 um 15:36 schrieb Christian König: >>> Hi everybody, >>> >>> in amdgpu we got the following issue which I'm seeking advise how to cleanly handle it. >>> >>> We have a bunch of trace points which are related to the VM subsystem and 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 really that useful, so I'm wondering if we could just overwrite the pid recorded 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. >>> >>> >