From patchwork Thu Dec 26 14:06:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Masami Hiramatsu (Google)" X-Patchwork-Id: 11310571 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8A82713A4 for ; Thu, 26 Dec 2019 14:06:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6078621569 for ; Thu, 26 Dec 2019 14:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577369193; bh=x9GnX+PrHTeZXUG6Uj8Jm/KjIXvJqw/p0hApKo59wvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=hFqluDHYM20DEAHIaa2UirlFBiTwNVuBVB7j02R5BAnxbb+uZj0cZTvUXbe2xjtcy SXq267WEs6prb/rf5b0JBdVaZi23ga+XTlExX6B/ww6bAcC5gldcNC0usD0wrzAlJp Yr29Hkvn2D+LDLaSxSNIK1b5OzLlsJ9fsfejTCXc= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726659AbfLZOGc (ORCPT ); Thu, 26 Dec 2019 09:06:32 -0500 Received: from mail.kernel.org ([198.145.29.99]:52316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726450AbfLZOGc (ORCPT ); Thu, 26 Dec 2019 09:06:32 -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 35B4D2053B; Thu, 26 Dec 2019 14:06:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577369192; bh=x9GnX+PrHTeZXUG6Uj8Jm/KjIXvJqw/p0hApKo59wvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bp7yi+9GC0df1Iehwg+jJ8ETW6VDesuF+VUJtt02+kkfr13LPgGBPUzUxzn+k225N 3BwMymTuTjRfNpQ2LQE87Q6vAyXOw+bcIKde8mxRiluhHQkyNVL87EGosYjO8vjWow iJCsauPflxJDl9WXCU4L7dJJif3y1djnMofTAQR0= From: Masami Hiramatsu To: Steven Rostedt , Frank Rowand Cc: Ingo Molnar , 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 v5 13/22] tracing: Accept different type for synthetic event fields Date: Thu, 26 Dec 2019 23:06:25 +0900 Message-Id: <157736918549.11126.5446647426786150440.stgit@devnote2> X-Mailer: git-send-email 2.20.1 In-Reply-To: <157736902773.11126.2531161235817081873.stgit@devnote2> References: <157736902773.11126.2531161235817081873.stgit@devnote2> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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 --- 0 files changed 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; }