From patchwork Wed Jun 14 22:27:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Linton X-Patchwork-Id: 105601 Delivered-To: patch@linaro.org Received: by 10.140.91.77 with SMTP id y71csp512319qgd; Wed, 14 Jun 2017 15:28:33 -0700 (PDT) X-Received: by 10.101.76.136 with SMTP id m8mr2099697pgt.159.1497479313259; Wed, 14 Jun 2017 15:28:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1497479313; cv=none; d=google.com; s=arc-20160816; b=P8p8ieDgTMpyKMAFtsL96dGF0lxFzOMlQhEjJ5buw1zKf6NNgg+wBgLdHqskGbr9G7 LqSMgsXrGaKtAaPqLMelSJBGLg58cxOsyLiYiCgFZ19sYM+OsIPF1OlR1yolLMxDUC7o eqU9XDjA1VgXTCgzpU4Yx89oAZpCgwPcSzV0IPCpWc7CqetqwSyMg3MXethAs9OWiOuy JOIPpxFCGlvh9UI4i9+ppFnAkfmVd/acQIumMO5XYS+oM0znkA36uCZj8esRLJNBN/Ee 6UYymFAY/y/n82FVfUsYDysXJQY+iLkdqQK0Sr4QqB4xnSNsU1Povkep8+hcAuAb5uCa Vx/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=yvkPOZ6DRt3RvUy8f41O06+K/mPhqhHLx6SFA4JH/Wg=; b=kyp0Nv0YdvNL45IuQDdo7cJxxLeM2hknvLfW81Dl7N3lexJMFfLf6yTQPiSs4Z6fT5 DNhxsLnK3fyYkFqqQ1EA6bloeT+nu2nmd8eCrUCh2CieIQFuQ6bsLfV5hOwN3PZVuKru nuHxgiiPPMJZK450seZvimlBAaPEEjtLPKde2bYM13gYJPLyM9vMhTQw7l+nPSP+YZZ4 ygJlogeXosLYC2jGDHBc5aFwKRVU2ZcrmL/Bx/w7pAlvZLPBjRXtN50EEbQ4zQKhm9r2 qW5EPsAJ+8MIo/LvdCkZorm3boRdjpQb+Wj/3g+2AKpoWFvzMBSTqA9yA/lHubAOTz/A yqsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2si856723pfe.51.2017.06.14.15.28.32; Wed, 14 Jun 2017 15:28:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752850AbdFNW2U (ORCPT + 25 others); Wed, 14 Jun 2017 18:28:20 -0400 Received: from foss.arm.com ([217.140.101.70]:39708 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752700AbdFNW1i (ORCPT ); Wed, 14 Jun 2017 18:27:38 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DE3A219BF; Wed, 14 Jun 2017 15:27:37 -0700 (PDT) Received: from beelzebub.ast.arm.com (beelzebub.austin.arm.com [10.118.12.119]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 55C413F5C9; Wed, 14 Jun 2017 15:27:37 -0700 (PDT) From: Jeremy Linton To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, rusty@rustcorp.com.au, jeyu@redhat.com, kirill.shutemov@linux.intel.com, christoffer.dall@linaro.org, marc.zyngier@arm.com, jcm@jonmasters.org, clemens@ladisch.de, perex@perex.cz Subject: [PATCH v2 12/13] tracing: Replace some magic constants with sizeof() Date: Wed, 14 Jun 2017 17:27:28 -0500 Message-Id: <20170614222729.16521-13-jeremy.linton@arm.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170614222729.16521-1-jeremy.linton@arm.com> References: <20170614222729.16521-1-jeremy.linton@arm.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that sizeof() works in TP_printk, lets replace a few cases in the kernel where the element size is hardcoded rather than using sizeof(). Signed-off-by: Jeremy Linton --- include/trace/events/thermal.h | 4 +++- include/trace/events/thermal_power_allocator.h | 4 ++-- sound/firewire/motu/amdtp-motu-trace.h | 12 ++++++++---- 3 files changed, 13 insertions(+), 7 deletions(-) -- 2.9.4 diff --git a/include/trace/events/thermal.h b/include/trace/events/thermal.h index 6cde5b3..fad25224 100644 --- a/include/trace/events/thermal.h +++ b/include/trace/events/thermal.h @@ -90,6 +90,8 @@ TRACE_EVENT(thermal_zone_trip, show_tzt_type(__entry->trip_type)) ); +TRACE_DEFINE_SIZEOF(u32); + TRACE_EVENT(thermal_power_cpu_get_power, TP_PROTO(const struct cpumask *cpus, unsigned long freq, u32 *load, size_t load_len, u32 dynamic_power, u32 static_power), @@ -118,7 +120,7 @@ TRACE_EVENT(thermal_power_cpu_get_power, TP_printk("cpus=%s freq=%lu load={%s} dynamic_power=%d static_power=%d", __get_bitmask(cpumask), __entry->freq, - __print_array(__get_dynamic_array(load), __entry->load_len, 4), + __print_array(__get_dynamic_array(load), __entry->load_len, sizeof(u32)), __entry->dynamic_power, __entry->static_power) ); diff --git a/include/trace/events/thermal_power_allocator.h b/include/trace/events/thermal_power_allocator.h index 5afae8f..5f0ef92 100644 --- a/include/trace/events/thermal_power_allocator.h +++ b/include/trace/events/thermal_power_allocator.h @@ -45,10 +45,10 @@ TRACE_EVENT(thermal_power_allocator, TP_printk("thermal_zone_id=%d req_power={%s} total_req_power=%u granted_power={%s} total_granted_power=%u power_range=%u max_allocatable_power=%u current_temperature=%d delta_temperature=%d", __entry->tz_id, __print_array(__get_dynamic_array(req_power), - __entry->num_actors, 4), + __entry->num_actors, sizeof(u32)), __entry->total_req_power, __print_array(__get_dynamic_array(granted_power), - __entry->num_actors, 4), + __entry->num_actors, sizeof(u32)), __entry->total_granted_power, __entry->power_range, __entry->max_allocatable_power, __entry->current_temp, __entry->delta_temp) diff --git a/sound/firewire/motu/amdtp-motu-trace.h b/sound/firewire/motu/amdtp-motu-trace.h index cd0cbfa9..22babfa 100644 --- a/sound/firewire/motu/amdtp-motu-trace.h +++ b/sound/firewire/motu/amdtp-motu-trace.h @@ -18,6 +18,8 @@ static void copy_sph(u32 *frame, __be32 *buffer, unsigned int data_blocks, static void copy_message(u64 *frames, __be32 *buffer, unsigned int data_blocks, unsigned int data_block_quadlets); +TRACE_DEFINE_SIZEOF(u32); + TRACE_EVENT(in_data_block_sph, TP_PROTO(struct amdtp_stream *s, unsigned int data_blocks, __be32 *buffer), TP_ARGS(s, data_blocks, buffer), @@ -38,7 +40,7 @@ TRACE_EVENT(in_data_block_sph, __entry->src, __entry->dst, __entry->data_blocks, - __print_array(__get_dynamic_array(tstamps), __entry->data_blocks, 4) + __print_array(__get_dynamic_array(tstamps), __entry->data_blocks, sizeof(u32)) ) ); @@ -62,10 +64,12 @@ TRACE_EVENT(out_data_block_sph, __entry->src, __entry->dst, __entry->data_blocks, - __print_array(__get_dynamic_array(tstamps), __entry->data_blocks, 4) + __print_array(__get_dynamic_array(tstamps), __entry->data_blocks, sizeof(u32)) ) ); +TRACE_DEFINE_SIZEOF(u64); + TRACE_EVENT(in_data_block_message, TP_PROTO(struct amdtp_stream *s, unsigned int data_blocks, __be32 *buffer), TP_ARGS(s, data_blocks, buffer), @@ -86,7 +90,7 @@ TRACE_EVENT(in_data_block_message, __entry->src, __entry->dst, __entry->data_blocks, - __print_array(__get_dynamic_array(messages), __entry->data_blocks, 8) + __print_array(__get_dynamic_array(messages), __entry->data_blocks, sizeof(u64)) ) ); @@ -110,7 +114,7 @@ TRACE_EVENT(out_data_block_message, __entry->src, __entry->dst, __entry->data_blocks, - __print_array(__get_dynamic_array(messages), __entry->data_blocks, 8) + __print_array(__get_dynamic_array(messages), __entry->data_blocks, sizeof(u64)) ) );