Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp859475ybi; Fri, 21 Jun 2019 09:19:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxyFY8xqLf4dLCWtjbnzOhJrwT0V8oXfJkkXf15tsyb0oiUS6VL9e5zeKf0T087/QNFIivS X-Received: by 2002:a17:902:110b:: with SMTP id d11mr62142419pla.213.1561133981223; Fri, 21 Jun 2019 09:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561133981; cv=none; d=google.com; s=arc-20160816; b=aoezWW3a6h/QNNkDH4xKuwc/fcLlJeyiZFOeZ5WP7Cjyr15xKRvop7R90uyVr8u+nU hrn98zINbsZc0dFJr+23DcOgK8d79Isxt5KHGR/wLALaiu0ci8p2bmx1CSAP0fZrPMRy 6DuGHt5IYL/UDxeJ0E4iI6uTHb/6ndxmPEzBfFc9DD5hw3YrvKz4uEx2Z5IQZLggPIfp aMhKwLwECfnvGFgdu4A/rsrTlR/siEq0Z4LGVU1e962wm75sxM96I+musPVzYPXT54VS woDJov/GhzxADyJ6BXWyONRiyMZ0BNFkUg3JPsL07PGewYWNYK5PaGxz/AMu+t+YGGvi wxLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F/gTmJktYT1Z8zkmg9uyP2DsUZINRQ61HVpyR68P+74=; b=YmPZ0fno3UreAAon0sUgZrUJc2QZ42Ew2ojCSI6hvcnu5yMbJhGqMnhJ1virKgFMje Tg143k3LtEhcoDXdg+W7hKIGlesL80izDfeHNiLVNKJFClVAeJ6luWV+B/XguvjlX7eI sQ4DakLDh/hiHF099CTAqKyy19x3bBbasmQtJjsYfnLL9wWudjaIxNYarj67x8l9DnZM xHSoCnd8mN9u3HP5upYmE9fouHeMrUBBaT48KFUqBZM0fXU+yy2VTSUXeeFp/wGg/Exf hG2kmjDJHvx5DUP+gCby4ALSKceVmSMcR4+3KJLf2XmKzTRXEFwt9qrt6mxttaDSM9nm fprQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="zwk//BBa"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si3291576pfb.1.2019.06.21.09.19.25; Fri, 21 Jun 2019 09:19:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b="zwk//BBa"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726424AbfFUQS5 (ORCPT + 99 others); Fri, 21 Jun 2019 12:18:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:51638 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726032AbfFUQSz (ORCPT ); Fri, 21 Jun 2019 12:18:55 -0400 Received: from localhost.localdomain (NE2965lan1.rev.em-net.ne.jp [210.141.244.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 538B1208CA; Fri, 21 Jun 2019 16:18:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1561133934; bh=FEs3TMM0ZYwBf3dusmpCVE/U5ogVTBo5jlcOMzlVOu4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zwk//BBasckgqi8kWaocl4ToLQ1Rx9sa0tk1lEw/lUcb4LPpGM8SHoQbU6j5Akreq aOvEHxBDJLQtXxzbLpPUfu2gkOSgmS2Nk5Kq1MEbue7qmKjQ68GrbDzQghL7LFuPJJ FH2DHyIIsLvrpR6Puru7osTsAjyAEc1As2R7enqs= From: Masami Hiramatsu To: Steven Rostedt , Rob Herring , Frank Rowand , Tom Zanussi Cc: Ingo Molnar , Namhyung Kim , Jiri Olsa , Arnaldo Carvalho de Melo , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Subject: [RFC PATCH 05/11] tracing: Accept different type for synthetic event fields Date: Sat, 22 Jun 2019 01:18:50 +0900 Message-Id: <156113392998.28344.16677403249383913005.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <156113387975.28344.16009584175308192243.stgit@devnote2> References: <156113387975.28344.16009584175308192243.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make the synthetic event accepts a different type field to record. However, the size and signed flag must be same. Signed-off-by: Masami Hiramatsu --- kernel/trace/trace_events_hist.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index ca6b0dff60c5..a7f447195143 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -4063,8 +4063,11 @@ static int check_synth_field(struct synth_event *event, field = event->fields[field_pos]; - if (strcmp(field->type, hist_field->type) != 0) - return -EINVAL; + if (strcmp(field->type, hist_field->type) != 0) { + if (field->size != hist_field->size || + field->is_signed != hist_field->is_signed) + return -EINVAL; + } return 0; }