Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp344122yba; Thu, 18 Apr 2019 02:10:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqwqzN2C06/8lflmqpnis3gT+PJHj5ua9PrUhgsxfp0uO1AAev6e0ecqk2fDUpOpbmT/363d X-Received: by 2002:a17:902:8f92:: with SMTP id z18mr96159786plo.123.1555578619931; Thu, 18 Apr 2019 02:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555578619; cv=none; d=google.com; s=arc-20160816; b=Ae1ESQDs36k4L8Pd6JJ6elZp8Hvtuy+YUAKetc35J0s4F8KHMlc8BpLICMv/Cb9zyn qLaE330rnahk2523X97L/EK5EfIkV60zkL9Ncgu1komHwa7ihgBGWYtTUS1Dzx615aU0 pSzyPBiaQL0TCPLzx8jvgLVcU4KquAJyh5kDDshnce3OnjajQCaM3R0ttknZQTaTgVd+ o35gmG/r9fce58CDYqSG+HU7nX4J0c3MsacfNEyUya+oQU9OJNQPSXh58/uRcnxCKTsC lsx9oWZ8f6M/X75EnOQKDNqcWaOwgAiaiScmUoNosLt/FvJwlkPo3DpB5OFcsRSj5oLv jkCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:subject:cc:to :from:date:user-agent:message-id; bh=TmdqglcunI4wOAmrjgXMIH7hh4Tcg955OWTpIeEnbW8=; b=kyWYkgnVL0DnEG1QSwXeqB5P7iYVUhAI9D7kxpInMM/kjvK9cR3dHwgCVcg/4kqQSR Um3r43odZS6VhSTAbu3rMbWNVQHU6323I/DnsETJ2YR+qBHuK3XH+iahrzQkfV2KsPDr WyzUsYTVaV3+euY8LM80Ce+ZXhdzLIHi7/zBd7WetmkhccrOSZZc3RdF8A4irBsk5Kt1 DnD2EU4XoT75eXfNZAqK6NHeb8V0fdZXv+E8r0NStan/+byA6gILc5+xfdei1J3dsU1j +AqNfRKPYU9CQU7Tic0syx1Zvmp3mWVZDIMrek5CN7SUnWxrRbnEmGmtnuhbfz0xxwWY PyFg== 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 y29si1474715pgk.120.2019.04.18.02.10.04; Thu, 18 Apr 2019 02:10:19 -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 S2388515AbfDRJHa (ORCPT + 99 others); Thu, 18 Apr 2019 05:07:30 -0400 Received: from Galois.linutronix.de ([146.0.238.70]:33992 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388426AbfDRJHW (ORCPT ); Thu, 18 Apr 2019 05:07:22 -0400 Received: from localhost ([127.0.0.1] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1hH30D-0001tl-Se; Thu, 18 Apr 2019 11:06:42 +0200 Message-Id: <20190418084254.910579307@linutronix.de> User-Agent: quilt/0.65 Date: Thu, 18 Apr 2019 10:41:39 +0200 From: Thomas Gleixner To: LKML Cc: Josh Poimboeuf , x86@kernel.org, Andy Lutomirski , Steven Rostedt , Alexander Potapenko , Alexey Dobriyan , Andrew Morton , Pekka Enberg , linux-mm@kvack.org, David Rientjes , Christoph Lameter , Catalin Marinas , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Mike Rapoport , Akinobu Mita , iommu@lists.linux-foundation.org, Robin Murphy , Christoph Hellwig , Marek Szyprowski , Johannes Thumshirn , David Sterba , Chris Mason , Josef Bacik , linux-btrfs@vger.kernel.org, dm-devel@redhat.com, Mike Snitzer , Alasdair Kergon , intel-gfx@lists.freedesktop.org, Joonas Lahtinen , Maarten Lankhorst , dri-devel@lists.freedesktop.org, David Airlie , Jani Nikula , Daniel Vetter , Rodrigo Vivi , linux-arch@vger.kernel.org Subject: [patch V2 20/29] tracing: Simplify stacktrace retrieval in histograms References: <20190418084119.056416939@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The indirection through struct stack_trace is not necessary at all. Use the storage array based interface. Signed-off-by: Thomas Gleixner Cc: Steven Rostedt --- kernel/trace/trace_events_hist.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -5186,7 +5186,6 @@ static void event_hist_trigger(struct ev u64 var_ref_vals[TRACING_MAP_VARS_MAX]; char compound_key[HIST_KEY_SIZE_MAX]; struct tracing_map_elt *elt = NULL; - struct stack_trace stacktrace; struct hist_field *key_field; u64 field_contents; void *key = NULL; @@ -5198,14 +5197,9 @@ static void event_hist_trigger(struct ev key_field = hist_data->fields[i]; if (key_field->flags & HIST_FIELD_FL_STACKTRACE) { - stacktrace.max_entries = HIST_STACKTRACE_DEPTH; - stacktrace.entries = entries; - stacktrace.nr_entries = 0; - stacktrace.skip = HIST_STACKTRACE_SKIP; - - memset(stacktrace.entries, 0, HIST_STACKTRACE_SIZE); - save_stack_trace(&stacktrace); - + memset(entries, 0, HIST_STACKTRACE_SIZE); + stack_trace_save(entries, HIST_STACKTRACE_DEPTH, + HIST_STACKTRACE_SKIP); key = entries; } else { field_contents = key_field->fn(key_field, elt, rbe, rec);