From patchwork Tue Sep 1 15:41:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 293093 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAEDDC433E6 for ; Tue, 1 Sep 2020 16:06:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A22EA204EC for ; Tue, 1 Sep 2020 16:06:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mA3uSmG9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731580AbgIAQFr (ORCPT ); Tue, 1 Sep 2020 12:05:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727977AbgIAPlO (ORCPT ); Tue, 1 Sep 2020 11:41:14 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9761C061245; Tue, 1 Sep 2020 08:41:12 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 7so868234pgm.11; Tue, 01 Sep 2020 08:41:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EOpWZ0ELYdwerIMhBnjgWjf7bTpYIpZc4bq4YnoG+QE=; b=mA3uSmG9cowbsBaeHbRW48Au4E+lHsdQ0VQeLYF2rGLjvsP06Y3UeIkPHH6eBFTqLI sDIaPszTNO6DZ6YkQzzMWDK6okmQ3gBmm0ppC5Vix8DhFHm0rcxaSrm1OljLyUdT4ySV 289XS8TTy7zBZcuZ55wbqnNJglQdXlcoeB1lb8ShsYjwRbqDftCEDFFjPaiQ7k0EPD99 DXthn0T2mVCZZ8Kx7K0BQ1PP+Ei7ndlMST2NuIkQoyJjrA35nAeV5+3l4EFkXAkVowd+ pCbPSyvEznK5ecz873Ckah50p7H8Z74mbzyECR3aKy8pGFzCZrK/wJg4mfst9BlOTr4Y 58Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EOpWZ0ELYdwerIMhBnjgWjf7bTpYIpZc4bq4YnoG+QE=; b=oqT127QDHqo2GeO/FSBmKmXT7T4UOqixvmCJNKwAFWAbEqEL2q9yc5L5Yd/9jvzRdr RxODcJen5P4ra4qO6NGkeEYCrhMnQPjs5GRfef1/Pvk9kMnKam5DAlGvxrxz3dUqBxND EXXq9b9IYnlHDgyJ5fOsvEeP3+ad9xmxziwPj1LmsvxGwjeO1cuthLZFF7apYMFiT9+p VQ63ahEU8ldlKDxY3tr0eQBbDrx07pVrK+KzfBVhbSwJLllcw8Q5Kui7L/CKziwwRFni FBrNN5s21uFTs46lmACHVSMPWHR+Yp2nFaux1DRSZhEz+1AwzWBK2fFOVcrgd4Y93wdj cFgQ== X-Gm-Message-State: AOAM530EHfDeGZLCJtgcL7+cQ/n1Qh6XAhvGbf3x9Io7xlHcXXEIy1oB tRD6EAdI4CGbVuKL1VeZgxk= X-Google-Smtp-Source: ABdhPJwtgd9Ek5sIobvbt+/pH9d9tOn+rALzHVWZVooH6IYDGTqv9IgLj3nad1MO5Ul36xMn84w7wQ== X-Received: by 2002:a62:6547:: with SMTP id z68mr2393327pfb.286.1598974872309; Tue, 01 Sep 2020 08:41:12 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id h11sm1260709pfe.185.2020.09.01.08.41.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 08:41:11 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Sharat Masetty , Akhil P Oommen , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 1/3] drm/msm/gpu: Add GPU freq_change traces Date: Tue, 1 Sep 2020 08:41:54 -0700 Message-Id: <20200901154200.2451899-2-robdclark@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901154200.2451899-1-robdclark@gmail.com> References: <20200901154200.2451899-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark Technically the GMU specific one is a bit redundant, but it was useful to track down a bug. Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/a6xx_gmu.c | 3 +++ drivers/gpu/drm/msm/msm_gpu.c | 2 ++ drivers/gpu/drm/msm/msm_gpu_trace.h | 31 +++++++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c index 46a29e383bfd..ab1e9eb619e0 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gmu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gmu.c @@ -11,6 +11,7 @@ #include "a6xx_gpu.h" #include "a6xx_gmu.xml.h" #include "msm_gem.h" +#include "msm_gpu_trace.h" #include "msm_mmu.h" static void a6xx_gmu_fault(struct a6xx_gmu *gmu) @@ -124,6 +125,8 @@ void a6xx_gmu_set_freq(struct msm_gpu *gpu, struct dev_pm_opp *opp) gmu->current_perf_index = perf_index; gmu->freq = gmu->gpu_freqs[perf_index]; + trace_msm_gmu_freq_change(gmu->freq, perf_index); + /* * This can get called from devfreq while the hardware is idle. Don't * bring up the power if it isn't already active diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index d5645472b25d..b02866527386 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -32,6 +32,8 @@ static int msm_devfreq_target(struct device *dev, unsigned long *freq, if (IS_ERR(opp)) return PTR_ERR(opp); + trace_msm_gpu_freq_change(dev_pm_opp_get_freq(opp)); + if (gpu->funcs->gpu_set_freq) gpu->funcs->gpu_set_freq(gpu, opp); else diff --git a/drivers/gpu/drm/msm/msm_gpu_trace.h b/drivers/gpu/drm/msm/msm_gpu_trace.h index 122b84789238..07572ab179fa 100644 --- a/drivers/gpu/drm/msm/msm_gpu_trace.h +++ b/drivers/gpu/drm/msm/msm_gpu_trace.h @@ -83,6 +83,37 @@ TRACE_EVENT(msm_gpu_submit_retired, __entry->start_ticks, __entry->end_ticks) ); + +TRACE_EVENT(msm_gpu_freq_change, + TP_PROTO(u32 freq), + TP_ARGS(freq), + TP_STRUCT__entry( + __field(u32, freq) + ), + TP_fast_assign( + /* trace freq in MHz to match intel_gpu_freq_change, to make life easier + * for userspace + */ + __entry->freq = DIV_ROUND_UP(freq, 1000000); + ), + TP_printk("new_freq=%u", __entry->freq) +); + + +TRACE_EVENT(msm_gmu_freq_change, + TP_PROTO(u32 freq, u32 perf_index), + TP_ARGS(freq, perf_index), + TP_STRUCT__entry( + __field(u32, freq) + __field(u32, perf_index) + ), + TP_fast_assign( + __entry->freq = freq; + __entry->perf_index = perf_index; + ), + TP_printk("freq=%u, perf_index=%u", __entry->freq, __entry->perf_index) +); + #endif #undef TRACE_INCLUDE_PATH From patchwork Tue Sep 1 15:41:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 250477 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AE81BC433E6 for ; Tue, 1 Sep 2020 16:05:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8E781204EC for ; Tue, 1 Sep 2020 16:05:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="c703Ej1o" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728597AbgIAQFp (ORCPT ); Tue, 1 Sep 2020 12:05:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55890 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730187AbgIAPlQ (ORCPT ); Tue, 1 Sep 2020 11:41:16 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D12C061246; Tue, 1 Sep 2020 08:41:15 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id e33so887438pgm.0; Tue, 01 Sep 2020 08:41:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UrLlTmYG1RGdAv4uh1a2Vj9Ca0f5vJ6xgSyvmtjMFJ8=; b=c703Ej1oAv/twTNahzRLiABY2Gdfj7BHDVrm64a2qQIk4mlySrEPWPWhBXk/Z7YV7C 7KLjWx47ts3wDWsWsoN9gKXOjI3ISM8D5mAqiTDqv1CPUxYxVqQC4dhHxl/2jdg5HfYq /0V2gpsi/tRtSRlREjtuAU7/0/W1trOjERb0ON/1C9AXajlPBR/N6hqCBq6moOHQR671 KqDgmh1voQ822awqEID/n/fcfSkOiOvTBlUvycWF8edxaG8KXWfbRRRd+GKhFfrBF3G8 8wfE/zjANx9DOG98a6BPskMiedzWuGyVrZJfnj+WioMkmfOEhJeNtak0wQeSAcQ2Dwk9 f32A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UrLlTmYG1RGdAv4uh1a2Vj9Ca0f5vJ6xgSyvmtjMFJ8=; b=j9YcoYlFJmAphKVcNiGNiBVDEuKdC4VxCB6hD7fCgz5aDtRXDhkOrPWsQeflwPJmcz RkVTBtrh9G9gjCqF+59acqMFsbOVISPXOcUdNQbIKj9BUdTc+H6hn8qvdhAVw/X0ecDb OEJxAMCLGnMBr2AELQeCB+kuC8o8JMKEdse+5qICnuC2mJzOtXpkwPFmoL7OL5eowUan pBAqvNEyzNo4gAXTu5YgfZIv6D+F7CTlUaxOV0xYHqEo8IS7X3MWR8AiIchRThcpm099 F7ZlBCD2pnk1xT0LvOMJqEQ2fiiBx6M5oIPQ9rM90q2kJrD4T0pXDj5OZh4TunDOaYIV 25IA== X-Gm-Message-State: AOAM530TumLKO9RAPvM0XHloOybK+ytQzElQR0HovpcLbFwGOMwMzhKt kE5xAI7j6+/pkXnQHEsoqG8= X-Google-Smtp-Source: ABdhPJyFbCGyio3eMah/PcTiHzD5KOkPR/XDwROjdZrngkCxNWsVjpHitZHMPdN8toexNvaczokcKw== X-Received: by 2002:a63:5f8b:: with SMTP id t133mr2072708pgb.238.1598974875113; Tue, 01 Sep 2020 08:41:15 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id h11sm2454426pfq.101.2020.09.01.08.41.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 08:41:14 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 2/3] drm/msm: Convert shrinker msgs to tracepoints Date: Tue, 1 Sep 2020 08:41:55 -0700 Message-Id: <20200901154200.2451899-3-robdclark@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901154200.2451899-1-robdclark@gmail.com> References: <20200901154200.2451899-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark This reduces the spam in dmesg when we start hitting the shrinker, and replaces it with something we can put on a timeline while profiling or debugging system issues. Signed-off-by: Rob Clark Reviewed-by: Jordan Crouse Reviewed-by: Kristian H. Kristensen --- drivers/gpu/drm/msm/msm_gem_shrinker.c | 5 +++-- drivers/gpu/drm/msm/msm_gpu_trace.h | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_gem_shrinker.c b/drivers/gpu/drm/msm/msm_gem_shrinker.c index 722d61668a97..482576d7a39a 100644 --- a/drivers/gpu/drm/msm/msm_gem_shrinker.c +++ b/drivers/gpu/drm/msm/msm_gem_shrinker.c @@ -6,6 +6,7 @@ #include "msm_drv.h" #include "msm_gem.h" +#include "msm_gpu_trace.h" static bool msm_gem_shrinker_lock(struct drm_device *dev, bool *unlock) { @@ -87,7 +88,7 @@ msm_gem_shrinker_scan(struct shrinker *shrinker, struct shrink_control *sc) mutex_unlock(&dev->struct_mutex); if (freed > 0) - pr_info_ratelimited("Purging %lu bytes\n", freed << PAGE_SHIFT); + trace_msm_gem_purge(freed << PAGE_SHIFT); return freed; } @@ -123,7 +124,7 @@ msm_gem_shrinker_vmap(struct notifier_block *nb, unsigned long event, void *ptr) *(unsigned long *)ptr += unmapped; if (unmapped > 0) - pr_info_ratelimited("Purging %u vmaps\n", unmapped); + trace_msm_gem_purge_vmaps(unmapped); return NOTIFY_DONE; } diff --git a/drivers/gpu/drm/msm/msm_gpu_trace.h b/drivers/gpu/drm/msm/msm_gpu_trace.h index 07572ab179fa..1079fe551279 100644 --- a/drivers/gpu/drm/msm/msm_gpu_trace.h +++ b/drivers/gpu/drm/msm/msm_gpu_trace.h @@ -114,6 +114,32 @@ TRACE_EVENT(msm_gmu_freq_change, TP_printk("freq=%u, perf_index=%u", __entry->freq, __entry->perf_index) ); + +TRACE_EVENT(msm_gem_purge, + TP_PROTO(u32 bytes), + TP_ARGS(bytes), + TP_STRUCT__entry( + __field(u32, bytes) + ), + TP_fast_assign( + __entry->bytes = bytes; + ), + TP_printk("Purging %u bytes", __entry->bytes) +); + + +TRACE_EVENT(msm_gem_purge_vmaps, + TP_PROTO(u32 unmapped), + TP_ARGS(unmapped), + TP_STRUCT__entry( + __field(u32, unmapped) + ), + TP_fast_assign( + __entry->unmapped = unmapped; + ), + TP_printk("Purging %u vmaps", __entry->unmapped) +); + #endif #undef TRACE_INCLUDE_PATH From patchwork Tue Sep 1 15:41:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Clark X-Patchwork-Id: 293094 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39DA6C43461 for ; Tue, 1 Sep 2020 16:05:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 16C30206A5 for ; Tue, 1 Sep 2020 16:05:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MvTcpkuW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730569AbgIAQFR (ORCPT ); Tue, 1 Sep 2020 12:05:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730547AbgIAPlT (ORCPT ); Tue, 1 Sep 2020 11:41:19 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18844C061247; Tue, 1 Sep 2020 08:41:19 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id 7so868402pgm.11; Tue, 01 Sep 2020 08:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7KqqN6K3kTsWHUwp2VvfDs43IyNlxmbh5Rz2H4DpXUY=; b=MvTcpkuWrabD04S1aEsSpjZHdD73NAt33h8AERs424BwAOPPWupOWGhDL8C4WysYQZ 41ggRfkqK0UZfEMslBFKEbSzQSlVvulfxCMW2E8xy8hHHHhiiQGx3Ha3D1WYaa9sTc3X s/YwgBWcXjCh81KUhuirw1ap/a5dJKqgzvFkBGWkqZUUiYltChmcA5pNtKY66JE0QK5j C7fgThG8sVRMDUYVNo/tpLW7DsYRZkU8IHMcjqCStaOQdfkLIR/duqoLgVRLC3b+z595 rojXUfSiBvSTUXpOs/l0T8gTL9JwVkWdLEbzoXC0wAD///WBr4JCzivhk11lGUsGqCGU C8IQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7KqqN6K3kTsWHUwp2VvfDs43IyNlxmbh5Rz2H4DpXUY=; b=bJgK6gTn8kN+1apRo4M4KTLZ/S6HB4TOprVXEJLHuSN6eGnBRnP1emnE5jazXUixYn AqqCvJsIEWljunczNIG2uzMX2WjW9B6jsKiSerJA+fYrQMby+cI83BopzBDHHSxnO3Bi 9x4IAzuF2gwTkcXu7JQdBnR9rhiDEnK67PVHuycGoXmF2yuRoGjtDrMcKCjbBp7SlRiO hyZyuKsmKV6Uia4b2OGOlIIS2877cJIOs7zFwa7FFiU3mWvLno9P9Uu03yCFT4AhixAI kUkiYEeIZtNXPgmVJGoRKTI4a0SNaeXAk61WD6y+Tlzd03EXCjiiSB1SWmt2VClpIcLj Erxw== X-Gm-Message-State: AOAM532i0/ry0Kjb86st5waOC+XN954Ny+jJNuxunpc4KT8lXWo+KUKO FhnGnQL/YD5dYUxattWcNLc= X-Google-Smtp-Source: ABdhPJx/KUf682r2Q/Pzf9hmQEXca9myE+iw7tLtWfLbi+QoMiwtNbP5nGWRrF9YVDIFr3rsJZy7dA== X-Received: by 2002:aa7:9556:: with SMTP id w22mr2393992pfq.245.1598974878560; Tue, 01 Sep 2020 08:41:18 -0700 (PDT) Received: from localhost ([2601:1c0:5200:a6:307:a401:7b76:c6e5]) by smtp.gmail.com with ESMTPSA id w3sm2487343pff.56.2020.09.01.08.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Sep 2020 08:41:17 -0700 (PDT) From: Rob Clark To: dri-devel@lists.freedesktop.org Cc: Rob Clark , Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , Jonathan Marek , Eric Anholt , Sharat Masetty , Emil Velikov , linux-arm-msm@vger.kernel.org (open list:DRM DRIVER FOR MSM ADRENO GPU), freedreno@lists.freedesktop.org (open list:DRM DRIVER FOR MSM ADRENO GPU), linux-kernel@vger.kernel.org (open list) Subject: [PATCH 3/3] drm/msm/gpu: Add suspend/resume tracepoints Date: Tue, 1 Sep 2020 08:41:56 -0700 Message-Id: <20200901154200.2451899-4-robdclark@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200901154200.2451899-1-robdclark@gmail.com> References: <20200901154200.2451899-1-robdclark@gmail.com> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Rob Clark Signed-off-by: Rob Clark --- I'm not sure if there is a better way to do no-arg tracepoints? The trace framework seems to go out of it's way to make this difficult. Or maybe there is a more obvious thing that I'm not seeing. drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++++ drivers/gpu/drm/msm/msm_gpu.c | 2 ++ drivers/gpu/drm/msm/msm_gpu_trace.h | 26 ++++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c index c5a3e4d4c007..2de280e45077 100644 --- a/drivers/gpu/drm/msm/adreno/a6xx_gpu.c +++ b/drivers/gpu/drm/msm/adreno/a6xx_gpu.c @@ -923,6 +923,8 @@ static int a6xx_pm_resume(struct msm_gpu *gpu) gpu->needs_hw_init = true; + trace_msm_gpu_resume(0); + ret = a6xx_gmu_resume(a6xx_gpu); if (ret) return ret; @@ -937,6 +939,8 @@ static int a6xx_pm_suspend(struct msm_gpu *gpu) struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu); struct a6xx_gpu *a6xx_gpu = to_a6xx_gpu(adreno_gpu); + trace_msm_gpu_suspend(0); + devfreq_suspend_device(gpu->devfreq.devfreq); return a6xx_gmu_stop(a6xx_gpu); diff --git a/drivers/gpu/drm/msm/msm_gpu.c b/drivers/gpu/drm/msm/msm_gpu.c index b02866527386..5ceb2a966a87 100644 --- a/drivers/gpu/drm/msm/msm_gpu.c +++ b/drivers/gpu/drm/msm/msm_gpu.c @@ -202,6 +202,7 @@ int msm_gpu_pm_resume(struct msm_gpu *gpu) int ret; DBG("%s", gpu->name); + trace_msm_gpu_resume(0); ret = enable_pwrrail(gpu); if (ret) @@ -227,6 +228,7 @@ int msm_gpu_pm_suspend(struct msm_gpu *gpu) int ret; DBG("%s", gpu->name); + trace_msm_gpu_suspend(0); devfreq_suspend_device(gpu->devfreq.devfreq); diff --git a/drivers/gpu/drm/msm/msm_gpu_trace.h b/drivers/gpu/drm/msm/msm_gpu_trace.h index 1079fe551279..03e0c2536b94 100644 --- a/drivers/gpu/drm/msm/msm_gpu_trace.h +++ b/drivers/gpu/drm/msm/msm_gpu_trace.h @@ -140,6 +140,32 @@ TRACE_EVENT(msm_gem_purge_vmaps, TP_printk("Purging %u vmaps", __entry->unmapped) ); + +TRACE_EVENT(msm_gpu_suspend, + TP_PROTO(int dummy), + TP_ARGS(dummy), + TP_STRUCT__entry( + __field(u32, dummy) + ), + TP_fast_assign( + __entry->dummy = dummy; + ), + TP_printk("%u", __entry->dummy) +); + + +TRACE_EVENT(msm_gpu_resume, + TP_PROTO(int dummy), + TP_ARGS(dummy), + TP_STRUCT__entry( + __field(u32, dummy) + ), + TP_fast_assign( + __entry->dummy = dummy; + ), + TP_printk("%u", __entry->dummy) +); + #endif #undef TRACE_INCLUDE_PATH