Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp516728pxa; Wed, 12 Aug 2020 07:39:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEqLWXbqdAIcuIi1K2PdLWbHGiDWtQvBdq3teB6/S5xwwzF8esS1Jrq9bcXrD8/OMcTyp/ X-Received: by 2002:a17:906:228a:: with SMTP id p10mr87389eja.23.1597243182762; Wed, 12 Aug 2020 07:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597243182; cv=none; d=google.com; s=arc-20160816; b=gj+BlGBxXv/OO1lBS1GZDUrRIgMbo+9XX4BhNxZWSxSXLkJrcWgr3lkx11qkBe7Oen /w8dLm8s1i/+AXXUQEmndxsUwJeosuZ9FPhUoN8N2GXozB9AmtUV6ZVYO0Oq0Re6+i+T q7DpLUY1fVIPssOb5uPujkZ3Ubzf5GbrAclZdwFaUqk7D86lsy0M2oZOxmBtvxy0SGCn CODRuvAEuoEKMTzlWX5f1ZRAGoDyRkzXasqcWKvZg0oeflmA/z401IWXJpFQzdenvLWc gPVavzC3cfm/W3J9tRpCjDUNRdUrfUDl6qgcRHFKH7RjF0UCca+7fVVXSwAhIK3VvIcX 224A== 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=oup0ovJVk0ZzLFn1WFt+Fd6kUmlpI1Q5XsgroeR5poY=; b=NFxArKryTtb+H9h312ATPV+KiILI2/1FDym/aXOwHQGuO+B60gUv9ZZDxsv3uMl6C2 sL7YKGPI1ZVWaSLF/h0XhUSJk/LzXbv3rOBsWV8+uDp4v48NfM5kjFH6u5adrSJgbrUG JiSu76KrxtoRMvIaQ+VPa7OcyPuyCBFQjTvIdX3w7SQTf2nt8yLVgmgUSGXQqDaokExY 6BJx1loAlU4Ml6mObm7GbPVuYc44TOtg/tF90udqTN3qxfPcxV87WOcleNXOdY3w0bZ9 X0axhmy4dbryGcFluDqkJCdsLvH2AeihyMF+qlN53S11Il9s8Qhy2x34ZOaBGjlUqbcD 8pQA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KfP8+LSt; 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 x6si1643367ede.204.2020.08.12.07.39.19; Wed, 12 Aug 2020 07:39:42 -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=KfP8+LSt; 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 S1726505AbgHLOgn (ORCPT + 99 others); Wed, 12 Aug 2020 10:36:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726485AbgHLOgm (ORCPT ); Wed, 12 Aug 2020 10:36:42 -0400 Received: from mail-ej1-x643.google.com (mail-ej1-x643.google.com [IPv6:2a00:1450:4864:20::643]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CBF03C061383 for ; Wed, 12 Aug 2020 07:36:41 -0700 (PDT) Received: by mail-ej1-x643.google.com with SMTP id g19so2506940ejc.9 for ; Wed, 12 Aug 2020 07:36:41 -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=oup0ovJVk0ZzLFn1WFt+Fd6kUmlpI1Q5XsgroeR5poY=; b=KfP8+LStZaPc5Z+kDwKBbf3a3PVcSEbFW9YQWnzb2ElK6LQrgREOBBD0OVufN2AGhz R9blIm3AcWsvYq3uhNlwIA9SARzAoMl0OSLYBYPJsDuevSTlZ5Fh0UHeTpoPIzyKi1N3 BsGgEYk955QLOnC0FWMjt2OCpALHYSgk3t9zM4SAZ6ujzFN2DKbcbru2Q//CssA+mIOw IXfJMtg34u/gDJojAf94by279UTzeVv+LIcg4Ks2lubF0GldE/KSGNv90ATkdBkZ9EhY 8WoXcfEq0uCIj7xFvirx6myWruJxK276cy7pJIZYtqNESxGvsWZlCVeDgQqiJcrehcgY nhaA== 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=oup0ovJVk0ZzLFn1WFt+Fd6kUmlpI1Q5XsgroeR5poY=; b=JEVpF++C5ROFfUVz8vPFYusyVgk2TgfwLuul4NWBldwQbLpTdD2EcbsM4N2Qa9cexq wPdJpRz4EfEdQccc8BZMdeEApPqiIRHcmYsl7SETa1rufTgijBI4j915zH95vbtdxfQ6 t3W9dn/sietkCyWIc8NoppBYLw/KAA73HKuqAGJR0Vxd9IuHA3kSdQRT0DtVrwXW82zp rDD01N/va55bivf6zuSec7GWdPJqA4NnUPDiynlVBVh4G6pkYS2YSaTYZzLF1oNOUW/v Hlv/TMxnRkoEl958sIZ87aDYy9RuU8WiFc/BCTXJ30NDtu9B/804aPKBcl34YWnAW44p DjRg== X-Gm-Message-State: AOAM532ytnniAIIjMe2k17vTB7yhhttzcYakvgY9aRLd15VvKXfGOMj8 Gf5yOIuNWm2ROmOicjSNCjMvMgXU X-Received: by 2002:a17:906:3ac4:: with SMTP id z4mr71162ejd.65.1597243000527; Wed, 12 Aug 2020 07:36:40 -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 p16sm1681003ejd.27.2020.08.12.07.36.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 12 Aug 2020 07:36:39 -0700 (PDT) Reply-To: christian.koenig@amd.com Subject: Re: [PATCH] drm/amdgpu: adjust the pid in the grab_id trace point To: Steven Rostedt Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Shashank.Sharma@amd.com, daniel.vetter@ffwll.ch, alexander.deucher@amd.com References: <20200807133658.1866-1-christian.koenig@amd.com> <20200807133658.1866-2-christian.koenig@amd.com> <20200812141755.GA8136@home.goodmis.org> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: Date: Wed, 12 Aug 2020 16:36:36 +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: <20200812141755.GA8136@home.goodmis.org> 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 16:17 schrieb Steven Rostedt: > On Fri, Aug 07, 2020 at 03:36:58PM +0200, Christian König wrote: >> Trace something useful instead of the pid of a kernel thread here. >> >> Signed-off-by: Christian König >> --- >> drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h >> index 5da20fc166d9..07f99ef69d91 100644 >> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h >> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_trace.h >> @@ -228,6 +228,7 @@ TRACE_EVENT(amdgpu_vm_grab_id, >> ), >> >> TP_fast_assign( >> + __entry->ent.pid = vm->task_info.pid; > If the ent.pid is not the pid you are interested in for this trace event, just > add a "pid" field to the trace event and place it there. Do not modify the > generic pid that is recorded, as we would like that to be consistent for all > trace events. The problem my userspace guys have is that this doesn't work with "trace-cmd -P $pid". But I think I can teach them how filters work :) > The "ent.pid" turns into "common_pid" in the field, leaving "pid" free to use. > Other trace events (like sched_waking) record a pid field that is not the same > as the pid of the executing task. Yes, we thought about this alternative as well. > The "ent.pid" should always be the pid of the task that executed the event. Why? For the case here we just execute a work item in the background for an userspace process. Tracing the pid of the worker pool which executes it doesn't seem to make to much sense. Thanks for the quick reply, Christian. > > -- Steve > > >> __entry->pasid = vm->pasid; >> __assign_str(ring, ring->name) >> __entry->vmid = job->vmid; >> -- >> 2.17.1