Received: by 10.223.164.202 with SMTP id h10csp1627119wrb; Sat, 18 Nov 2017 02:59:05 -0800 (PST) X-Google-Smtp-Source: AGs4zMb11IQ+ITtrz62AfE7rJ6tCAOqbCEzTp5TsnXwrZHTBKdMQ02RvkZXJ/71BUW1B3uVzrJOE X-Received: by 10.84.224.75 with SMTP id a11mr8070422plt.421.1511002745464; Sat, 18 Nov 2017 02:59:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511002745; cv=none; d=google.com; s=arc-20160816; b=ac5zbFoa0PTyZUiYcQgHFhyPcqKiLg5PyElnMi64BXvp3WRpuAvS3UTK27aio+Zi0D 4rwbwO2zv0c6XdfRPbqg2KROwGnQ6V32CAguo88+BYuRPYr8QeXTlaoA80HhrW4j2je6 i8iopNKldJG2k7T7zYq8k93p64/gEfAGNOywpUshAPLnj8foWxv6ORCd5jDa5GF2JiUA MtLVFyNmcmbdS+eaAh4NiMssWoBWdULsDoOq2xe4D+hQl52lqMBxRONEySi14k8kYrOa +9W5LO9sFJX3LvcB22Z06f/EZuJyevtJQpN5Tls4rn673IciiDyiRgGLNofvrvkPWqqJ +MuQ== 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:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=V+amU7j5JLDL84SUNW5A2uLA7m5mtGtHgdux2OboXn8=; b=yK5xHoZVV4U4VqVMpLZXotpufd8ekTFFu8Debx5WX68BvyHXvOW6NPaxeYJ0GFqQsa p84jzxscBL0q7izHkEMfaDi4zdAzmUTozLuGbVQU5Y2FsJNat++mxnYRh4nTNvTRoFsH LBwZcFQXbp45XuZ8WwZnL+opN571IGF6o6MAXj84Z1oXrbd9Wyv03tmTvgCbqATweY5e bG/LJfzrHFzDG+PiEPuAf/cr4fcaBaycwSxrfSP5zTCWxd+JpbX3f3siR/2MXOPjdgpV o5yb4RKBWrc2VfvhNh1mcheTkvYWF38ZMmuFQ9BSRAJvRHq2H75SpuRNn10Qr2yhe/sQ Blgw== 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 f64si4817946pfk.57.2017.11.18.02.58.52; Sat, 18 Nov 2017 02:59:05 -0800 (PST) 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 S1761228AbdKQUnE (ORCPT + 93 others); Fri, 17 Nov 2017 15:43:04 -0500 Received: from mga09.intel.com ([134.134.136.24]:59828 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935868AbdKQUea (ORCPT ); Fri, 17 Nov 2017 15:34:30 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Nov 2017 12:34:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,411,1505804400"; d="scan'208";a="3904693" Received: from mjglynn-mobl.ger.corp.intel.com (HELO localhost) ([10.254.124.112]) by fmsmga001.fm.intel.com with ESMTP; 17 Nov 2017 12:34:26 -0800 From: Tom Zanussi To: rostedt@goodmis.org Cc: tglx@linutronix.de, mhiramat@kernel.org, namhyung@kernel.org, vedang.patel@intel.com, bigeasy@linutronix.de, joel.opensrc@gmail.com, joelaf@google.com, mathieu.desnoyers@efficios.com, baohong.liu@intel.com, rajvi.jingar@intel.com, julia@ni.com, fengguang.wu@intel.com, linux-kernel@vger.kernel.org, linux-rt-users@vger.kernel.org, Tom Zanussi Subject: [PATCH v6 13/37] tracing: Add hist_data member to hist_field Date: Fri, 17 Nov 2017 14:32:52 -0600 Message-Id: <88cc6b1f576d4d7877604af8a6ed4bccc60a410e.1510948725.git.tom.zanussi@linux.intel.com> X-Mailer: git-send-email 1.9.3 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow hist_data access via hist_field. Some users of hist_fields require or will require more access to the associated hist_data. Signed-off-by: Tom Zanussi --- kernel/trace/trace_events_hist.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 7e7428c..d0b818c 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -39,6 +39,7 @@ struct hist_field { unsigned int offset; unsigned int is_signed; struct hist_field *operands[HIST_FIELD_OPERANDS_MAX]; + struct hist_trigger_data *hist_data; }; static u64 hist_field_none(struct hist_field *field, void *event, @@ -420,7 +421,8 @@ static void destroy_hist_field(struct hist_field *hist_field, kfree(hist_field); } -static struct hist_field *create_hist_field(struct ftrace_event_field *field, +static struct hist_field *create_hist_field(struct hist_trigger_data *hist_data, + struct ftrace_event_field *field, unsigned long flags) { struct hist_field *hist_field; @@ -432,6 +434,8 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, if (!hist_field) return NULL; + hist_field->hist_data = hist_data; + if (flags & HIST_FIELD_FL_HITCOUNT) { hist_field->fn = hist_field_counter; goto out; @@ -445,7 +449,7 @@ static struct hist_field *create_hist_field(struct ftrace_event_field *field, if (flags & HIST_FIELD_FL_LOG2) { unsigned long fl = flags & ~HIST_FIELD_FL_LOG2; hist_field->fn = hist_field_log2; - hist_field->operands[0] = create_hist_field(field, fl); + hist_field->operands[0] = create_hist_field(hist_data, field, fl); hist_field->size = hist_field->operands[0]->size; goto out; } @@ -498,7 +502,7 @@ static void destroy_hist_fields(struct hist_trigger_data *hist_data) static int create_hitcount_val(struct hist_trigger_data *hist_data) { hist_data->fields[HITCOUNT_IDX] = - create_hist_field(NULL, HIST_FIELD_FL_HITCOUNT); + create_hist_field(hist_data, NULL, HIST_FIELD_FL_HITCOUNT); if (!hist_data->fields[HITCOUNT_IDX]) return -ENOMEM; @@ -544,7 +548,7 @@ static int create_val_field(struct hist_trigger_data *hist_data, } } - hist_data->fields[val_idx] = create_hist_field(field, flags); + hist_data->fields[val_idx] = create_hist_field(hist_data, field, flags); if (!hist_data->fields[val_idx]) { ret = -ENOMEM; goto out; @@ -654,7 +658,7 @@ static int create_key_field(struct hist_trigger_data *hist_data, } } - hist_data->fields[key_idx] = create_hist_field(field, flags); + hist_data->fields[key_idx] = create_hist_field(hist_data, field, flags); if (!hist_data->fields[key_idx]) { ret = -ENOMEM; goto out; -- 1.9.3 From 1584337688055112314@xxx Fri Nov 17 18:09:21 +0000 2017 X-GM-THRID: 1584337688055112314 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread