From patchwork Tue Apr 12 20:48:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 12811251 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0C7C6C433F5 for ; Tue, 12 Apr 2022 20:48:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD19410E512; Tue, 12 Apr 2022 20:48:42 +0000 (UTC) Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C09110E512 for ; Tue, 12 Apr 2022 20:48:41 +0000 (UTC) Received: by mail-pj1-x102e.google.com with SMTP id bg24so7179734pjb.1 for ; Tue, 12 Apr 2022 13:48:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=urlXTPABvBzroXiuItmppiPjWQeuvhtzk1FniGFCu20=; b=JlA8k1/yduTDEqbimNzsA8BSgcuT1BfKNkVOj/ouFlHMpjqgV6TcC1kk7MltuacGZK CuWYo2w53+iLnqz46nODFUslukSmcdO6KSYekHPhjj4yrNlZsIddMGhrap81xH+A9ERW IgITWj5bOxuT8mhPi9//07F838m2HHN2pFYH4Wk1h1pQN4GzkyYhQ7q214hajzooTec1 IPYrO7reTwHkUFq5mwjWlXwlr6I+DbQCIWbh03QdoBQQVCtq59lBlOPXR/9yohl28KGO lxrYgf5vfTmS5WLW5Yi+8avurzCg9bt8hefz+LyXTDTzfwdYHno51dDSq5UMqdq7XJJ0 35Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=urlXTPABvBzroXiuItmppiPjWQeuvhtzk1FniGFCu20=; b=3yJluY5bZf5wE/tmcqhDwzUrzx0pnDkn/Rao7Ylimak8wTEsJCe55ZyuRhmFhO7L5t bR9M05Zl8L/Sc5PfDSbeTMTiocfT8NFXh/rIhxUk7JQiHTzR7Ex2frK9EMdv6rjqUaSD MraakS8GktpoN3KDu3ncQ//qf3bZmNKdgOxtFfO1qcjoF4FlopBdyt9wxMvyUZCE58/+ 3fvnuvsW+WVLW6GlrSWSGY5axz/n6H/sVREw6EJUffy9nxtOSbTYDO6RtC4nHL3rvZou /9p7tom0wUQi+9ibPvP5X0t5hmtWPFfIdWe5wgrOoV9d/hngToC6bG0AKPAFpmukJIpi ZvfQ== X-Gm-Message-State: AOAM531MkvytchGS2OB9sVTs8Yen/G1zygfBtNhDZVQgH7N5rRWJQ0FM TRTwi6Z+uXgPSYli0yj24QseQTusCk4= X-Google-Smtp-Source: ABdhPJwHerIMQHF6OUwleCv1knH5ZhMLmo2a8u41izWsmFygBBCUuxOGn6rpjJgfrY1mZ8nlJyLbmw== X-Received: by 2002:a17:90b:3b86:b0:1cb:c243:aed3 with SMTP id pc6-20020a17090b3b8600b001cbc243aed3mr6284731pjb.202.1649796520835; Tue, 12 Apr 2022 13:48:40 -0700 (PDT) Received: from olv-glaptop3.lan ([2601:647:4400:452:1661:f107:58eb:51b7]) by smtp.gmail.com with ESMTPSA id r10-20020a17090a454a00b001c96a912aa0sm413548pjm.3.2022.04.12.13.48.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:48:40 -0700 (PDT) From: Chia-I Wu To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 1/2] drm/sched: use DECLARE_EVENT_CLASS Date: Tue, 12 Apr 2022 13:48:08 -0700 Message-Id: <20220412204809.824491-1-olvaffe@gmail.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Rob Clark Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" drm_sched_job and drm_run_job have the same prototype. v2: rename the class from drm_sched_job_entity to drm_sched_job (Andrey) Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky --- .../gpu/drm/scheduler/gpu_scheduler_trace.h | 31 +++++-------------- 1 file changed, 7 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 877ce9b127f1..188ae2105d57 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -32,7 +32,7 @@ #define TRACE_SYSTEM gpu_scheduler #define TRACE_INCLUDE_FILE gpu_scheduler_trace -TRACE_EVENT(drm_sched_job, +DECLARE_EVENT_CLASS(drm_sched_job, TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), TP_ARGS(sched_job, entity), TP_STRUCT__entry( @@ -59,31 +59,14 @@ TRACE_EVENT(drm_sched_job, __entry->job_count, __entry->hw_job_count) ); -TRACE_EVENT(drm_run_job, +DEFINE_EVENT(drm_sched_job, drm_sched_job, TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), - TP_ARGS(sched_job, entity), - TP_STRUCT__entry( - __field(struct drm_sched_entity *, entity) - __field(struct dma_fence *, fence) - __field(const char *, name) - __field(uint64_t, id) - __field(u32, job_count) - __field(int, hw_job_count) - ), + TP_ARGS(sched_job, entity) +); - TP_fast_assign( - __entry->entity = entity; - __entry->id = sched_job->id; - __entry->fence = &sched_job->s_fence->finished; - __entry->name = sched_job->sched->name; - __entry->job_count = spsc_queue_count(&entity->job_queue); - __entry->hw_job_count = atomic_read( - &sched_job->sched->hw_rq_count); - ), - TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", - __entry->entity, __entry->id, - __entry->fence, __entry->name, - __entry->job_count, __entry->hw_job_count) +DEFINE_EVENT(drm_sched_job, drm_run_job, + TP_PROTO(struct drm_sched_job *sched_job, struct drm_sched_entity *entity), + TP_ARGS(sched_job, entity) ); TRACE_EVENT(drm_sched_process_job, From patchwork Tue Apr 12 20:48:09 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chia-I Wu X-Patchwork-Id: 12811252 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C93D2C433F5 for ; Tue, 12 Apr 2022 20:48:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2A67410E5BA; Tue, 12 Apr 2022 20:48:45 +0000 (UTC) Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1439510E5BA for ; Tue, 12 Apr 2022 20:48:44 +0000 (UTC) Received: by mail-pl1-x634.google.com with SMTP id p10so85322plf.9 for ; Tue, 12 Apr 2022 13:48:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lvRZWn4PeQ0CZZZ1Egqv0aUk2QF3sUgfPcDvTT43nzM=; b=Iw3CXGJsYMuEPgqbp5hf2A9VrkJV9QrzyZOizpo+WyoH4FQu5oaPlHg8RmWlU32asw eZvdKmOHW3MLgwEXAXYh0ZNlNCEwYzGyuEbhnzKhmT4yiejZlTQGsFSWXmRg2AnWXS68 YLOoMUq2VvHEsSEcEUfA0XzoekSgrhKnZ0jp958p8yDFfu2xfWiWEqCz/82VW/H9fP6k ThtX7BQeV54n22z8DjHsiEkM8mqnvC575d7cDvTBcS3qVrxG5wqu5/Luxia6HV9RzbXU oluT+d6IJ3PCN/dfm4KtzkoywgvRKfoxWic9jj0k2F8n5F5PwcWQvjanIxnYwI/BE8nB WBhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lvRZWn4PeQ0CZZZ1Egqv0aUk2QF3sUgfPcDvTT43nzM=; b=WE5Vi4uvp0QeT9gX3+RhJNFz4bX/gVTbSZ7q9rHFn2U57I6sGSkekTcPFHpgrn6/2A dX3H14H+pCaErZ37KPEatqvnLM+tAsQ/jHKbWwZvhg8etGzhreSr8yJAEdymX3tv7TA6 9uLQ4SITvniWIAsLiKMAzXG17OEPLnwiBDrEtYwtBqHM9mk0SUOq0Jq1dID2y1/I3fMV zlqFMZpGnktKTjvKG69Zpz27D7fOE9aYx2hlrAdSpQSYFOQAeYUwihYZlygx4mMcCtCe DSV3dGets5382z85cHBfReF9Wlb7y4SiVTZop/8lt1YfkwqFmpTZmLMVTXWl6ooOiwtj HY8g== X-Gm-Message-State: AOAM531D3upqE+qI/0bDxEgu/hOyBbK6NG4xjNd5Q3DDi5MOEg342p85 zti96csMc52R0zT78Lay/pqASKTMP4g= X-Google-Smtp-Source: ABdhPJwIB1Csd7zLxDbLPSABQco67tsqHArKRSiwkTPIC7SGTP5YO4HkHoL0UO4oQEVM46Pj+TV8dw== X-Received: by 2002:a17:90b:224f:b0:1c9:949e:2202 with SMTP id hk15-20020a17090b224f00b001c9949e2202mr6938934pjb.56.1649796523329; Tue, 12 Apr 2022 13:48:43 -0700 (PDT) Received: from olv-glaptop3.lan ([2601:647:4400:452:1661:f107:58eb:51b7]) by smtp.gmail.com with ESMTPSA id r10-20020a17090a454a00b001c96a912aa0sm413548pjm.3.2022.04.12.13.48.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Apr 2022 13:48:42 -0700 (PDT) From: Chia-I Wu To: dri-devel@lists.freedesktop.org Subject: [PATCH v2 2/2] drm/sched: use __string in tracepoints Date: Tue, 12 Apr 2022 13:48:09 -0700 Message-Id: <20220412204809.824491-2-olvaffe@gmail.com> X-Mailer: git-send-email 2.35.1.1178.g4f1659d476-goog In-Reply-To: <20220412204809.824491-1-olvaffe@gmail.com> References: <20220412204809.824491-1-olvaffe@gmail.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Airlie , Rob Clark Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Otherwise, ring names are marked [UNSAFE-MEMORY]. Signed-off-by: Chia-I Wu Cc: Rob Clark Reviewed-by: Andrey Grodzovsky --- drivers/gpu/drm/scheduler/gpu_scheduler_trace.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h index 188ae2105d57..3143ecaaff86 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h +++ b/drivers/gpu/drm/scheduler/gpu_scheduler_trace.h @@ -38,7 +38,7 @@ DECLARE_EVENT_CLASS(drm_sched_job, TP_STRUCT__entry( __field(struct drm_sched_entity *, entity) __field(struct dma_fence *, fence) - __field(const char *, name) + __string(name, sched_job->sched->name) __field(uint64_t, id) __field(u32, job_count) __field(int, hw_job_count) @@ -48,14 +48,14 @@ DECLARE_EVENT_CLASS(drm_sched_job, __entry->entity = entity; __entry->id = sched_job->id; __entry->fence = &sched_job->s_fence->finished; - __entry->name = sched_job->sched->name; + __assign_str(name, sched_job->sched->name); __entry->job_count = spsc_queue_count(&entity->job_queue); __entry->hw_job_count = atomic_read( &sched_job->sched->hw_rq_count); ), TP_printk("entity=%p, id=%llu, fence=%p, ring=%s, job count:%u, hw job count:%d", __entry->entity, __entry->id, - __entry->fence, __entry->name, + __entry->fence, __get_str(name), __entry->job_count, __entry->hw_job_count) ); @@ -86,7 +86,7 @@ TRACE_EVENT(drm_sched_job_wait_dep, TP_PROTO(struct drm_sched_job *sched_job, struct dma_fence *fence), TP_ARGS(sched_job, fence), TP_STRUCT__entry( - __field(const char *,name) + __string(name, sched_job->sched->name) __field(uint64_t, id) __field(struct dma_fence *, fence) __field(uint64_t, ctx) @@ -94,14 +94,14 @@ TRACE_EVENT(drm_sched_job_wait_dep, ), TP_fast_assign( - __entry->name = sched_job->sched->name; + __assign_str(name, sched_job->sched->name); __entry->id = sched_job->id; __entry->fence = fence; __entry->ctx = fence->context; __entry->seqno = fence->seqno; ), TP_printk("job ring=%s, id=%llu, depends fence=%p, context=%llu, seq=%u", - __entry->name, __entry->id, + __get_str(name), __entry->id, __entry->fence, __entry->ctx, __entry->seqno) );