Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1299537ybg; Fri, 18 Oct 2019 15:27:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyPbFxW3t6/eu+6CSYtJMIXCaXKcXaJCJq3pgUd+dgAKOeewGtoP/CcnOXl7NttO/8WAERn X-Received: by 2002:a50:fa8e:: with SMTP id w14mr12352282edr.285.1571437670065; Fri, 18 Oct 2019 15:27:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571437670; cv=none; d=google.com; s=arc-20160816; b=B3KYgKaftds69/iFCTvSk0KhJ73i6MwVUQoSGOcgo4SYhedPrLuHORMEK0898Ewo63 o4QLqgfiy6vsd8eTMrlQtVLP1/Y4857jN/PGqviUzH/LIzTorHHdNFUpy8ILrylfb0Vc g/Pou5k2qzGPNj7d4OagPu6NZ8Ve15ZCyMoQzzgMoITLU8HqR0aNe5Bj+YztrLTUmuQF 6J97sZ5oE5/wt+HUpaCPVRYNO2ENGqbIyfXG92m4cvV8t69YNaLM3kbNJfVFB9gQPmIu Vy6ZKODXR5EFlPeLsnHJSFmXq7JCEPbS3e+fpuBlOWl9eP8vxloFG9huWEo3/eRP/SRf uvJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=8XF+9eFeW552QnkBd9hQGcDnB/YfmvQ/5/Cfl9dd8Pk=; b=HN+1FX2JxSN2iaNJ/NLIhJkZhFEKi4WLHXxPi97Yh9lrPDZDRqT6xbXDKPIPDi+cNF 85ycXhUPIih5cv67zLewGj3fxncRLadRVf9SYqfTNXxVTwtPAESY7rdZbI4uoKSlhieA R/2rbKLQSYZ6hmD8gvgkRZVWHN7UvEBMfjJL65fxavNvzNjGp5xIb6tmoENpvQcz6Ykh F3SnbJFKc8gMmaqToiqPESZ1jw6UkXPyrZSK3O8veCVak1Ph90JkDAQo7RGDuW8FQ26x aLi3X6QslSFT8jPFLPd0Q8uRtxUBjEJVQ+Oj0AmDuAglAJqLKAf94SdV9i570JIESwBD kYsQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d52si4820351ede.370.2019.10.18.15.27.27; Fri, 18 Oct 2019 15:27:50 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406767AbfJRBI4 (ORCPT + 99 others); Thu, 17 Oct 2019 21:08:56 -0400 Received: from mga01.intel.com ([192.55.52.88]:46857 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392283AbfJRBIz (ORCPT ); Thu, 17 Oct 2019 21:08:55 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Oct 2019 18:08:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,309,1566889200"; d="scan'208";a="202553412" Received: from intel10-debian.sh.intel.com ([10.239.53.1]) by FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2019 18:08:54 -0700 From: Zhengjun Xing To: rostedt@goodmis.org, mingo@redhat.com, tom.zanussi@linux.intel.com Cc: linux-kernel@vger.kernel.org, zhengjun.xing@linux.intel.com Subject: [PATCH v2] tracing: fix "gfp_t" format for synthetic events Date: Fri, 18 Oct 2019 09:20:34 +0800 Message-Id: <20191018012034.6404-1-zhengjun.xing@linux.intel.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the format of synthetic events, the "gfp_t" is shown as "signed:1", but in fact the "gfp_t" is "unsigned", should be shown as "signed:0". The issue can be reproduced by the following commands: echo 'memlatency u64 lat; unsigned int order; gfp_t gfp_flags; int migratetype' > /sys/kernel/debug/tracing/synthetic_events cat /sys/kernel/debug/tracing/events/synthetic/memlatency/format name: memlatency ID: 2233 format: field:unsigned short common_type; offset:0; size:2; signed:0; field:unsigned char common_flags; offset:2; size:1; signed:0; field:unsigned char common_preempt_count; offset:3; size:1; signed:0; field:int common_pid; offset:4; size:4; signed:1; field:u64 lat; offset:8; size:8; signed:0; field:unsigned int order; offset:16; size:4; signed:0; field:gfp_t gfp_flags; offset:24; size:4; signed:1; field:int migratetype; offset:32; size:4; signed:1; print fmt: "lat=%llu, order=%u, gfp_flags=%x, migratetype=%d", REC->lat, REC->order, REC->gfp_flags, REC->migratetype Signed-off-by: Zhengjun Xing --- kernel/trace/trace_events_hist.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index 57648c5aa679..7482a1466ebf 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -679,6 +679,8 @@ static bool synth_field_signed(char *type) { if (str_has_prefix(type, "u")) return false; + if (strcmp(type, "gfp_t") == 0) + return false; return true; } -- 2.17.1