Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp874401ybl; Fri, 10 Jan 2020 08:09:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwBsMOojbvNopudEoPaJaOqUBjlfixyKAiAsBS+x03h8K2LKDtUdYuUo4kup8l6CiP5t02y X-Received: by 2002:aca:1a06:: with SMTP id a6mr2660959oia.148.1578672566818; Fri, 10 Jan 2020 08:09:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578672566; cv=none; d=google.com; s=arc-20160816; b=Up9MUC6U6bPkOpIF4wxEUzF37GufgsD01dhPqdpUeD7HXT6BkRWzdwc910ac5k9iEU S7XQSo3fA4I/LsYI1f2g0UTS0Oit+mTPKKt4Pjiy4km2806wzrCA7k4Vl95rHQZCY5Pc SxsLRH2pur2OSoeRINQhWEPU/+H1ORGeeBXl3p4LDvSuGDXskptg+3r6JTvVjVjcmVpB QmPn/r2gE8fcWlDP5+IVvpUtJqCCQ1iJXgbbBT0nph9grpYh3tws6rwSla7rD56Fmzpc B5mL/5hAFEhUUmuTMOcAL5L9NNMtogWtX98wGGSZVn3zya91kkSHBEIlEQ3xt8tYqhna K9Mw== 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=2h0B3xu3Uw1hvmKmH/+W18ygqE+cNolkpaB6ES3LvrY=; b=fU8k/EIOzHVD2ATz0gaO1ZrLUti0j7BZF12c2PgZa5z86YXfGeGRlpwR4KY9LneUlj 31pzrZ3KMRghHuiUr5PmS8MrAP/qqQfj9WtX88HbGwUouUIVFoHKF6fWlCKfJaa9ao1U tj6vzIYyiU74s1Y2yFCApbWBJCWINS95PQAvH/6QGv3peyDKkexXLXYvAyWh7vNTIvi5 xA3egFkQL1s2tAk3Q49FDbPLwoPsCOgZSiz8TAw47jOmtbJ8b0xyYy+djhSLNxxDeYLd tHjGe6NASMAujfzbY/sMczkE4fkdC35ctZxcH2Xfg3lRZQKaKCTM+Ct5DTEq2SuQo3za dIEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bYuBaocw; 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 r12si1520658otq.156.2020.01.10.08.09.10; Fri, 10 Jan 2020 08:09:26 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bYuBaocw; 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 S1728833AbgAJQGB (ORCPT + 99 others); Fri, 10 Jan 2020 11:06:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:54422 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728585AbgAJQGA (ORCPT ); Fri, 10 Jan 2020 11:06:00 -0500 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 004C820848; Fri, 10 Jan 2020 16:05:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578672359; bh=r8TkR+YZ0nz5BjKES4oKL1ljV5KXeJigYvqY16isHSs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bYuBaocwEPuvtM3DNBvNtOM9kzj6RY1PPqZ2HTkVe3FI2LYITUQFtW5drvS6Wgvzu 3+kQEZaaW1WPcxzkz33I824WCkX7CBw8IQJsthuMricT9B66MskXdCSDVVLps6ZHnG ul7FMKNKlXlK/DDKyDRdPKp8tP55OxstlY8AlAxM= From: Masami Hiramatsu To: Steven Rostedt Cc: Ingo Molnar , Frank Rowand , Randy Dunlap , Namhyung Kim , Tim Bird , Jiri Olsa , Arnaldo Carvalho de Melo , Tom Zanussi , Rob Herring , Andrew Morton , Thomas Gleixner , Greg Kroah-Hartman , Alexey Dobriyan , Jonathan Corbet , Linus Torvalds , linux-doc@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 13/22] tracing: Accept different type for synthetic event fields Date: Sat, 11 Jan 2020 01:05:53 +0900 Message-Id: <157867235358.17873.61732996461602171.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157867220019.17873.13377985653744804396.stgit@devnote2> References: <157867220019.17873.13377985653744804396.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 f62de5f43e79..dae2c25b209a 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -4110,8 +4110,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; }