Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1740903ybg; Sat, 19 Oct 2019 01:29:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqyYLIzNJU9PgufRkH4YMKvWj583EeA/ZEemhiTpKmKvxZNRJZq8VH5ONr+mogIWrkUgnS4+ X-Received: by 2002:a05:6402:503:: with SMTP id m3mr14077978edv.157.1571473798293; Sat, 19 Oct 2019 01:29:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571473798; cv=none; d=google.com; s=arc-20160816; b=Hz3z8xWnwKrG7KGzFyXsme/HN1tx1nxasaONDGni4rirjYjjIu/b1b0SSv/Oxa/lvG tBaAQjnNuk5jK7CN5EXpr17xSNC8nJsRWJtZAw5hZepaRrzDcC3FCG7UFtVwORwFkSJd C7sThmg0mJMt/dxnHOMCp6iOAbgX95zyTl+yoAogvn421VMhESKEsTj7sddBh1nWw54G 2WgCHI5oRP+XQo7xNTjT/JU61K3/rUWjWs43ydSJfu8kOAXfxBCPwnC2NPcw+6r82CN6 RMOIaqngVea0wKOKxVwJ2ZLOmD7VBBITbZWbbWZqCLVwHc32+OA1uV+LMr3NLmKWqf3E x7jw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=xNGdgHruA5J19tFRbn7rNXD9EysL95snfOt6gxcSvv8=; b=cPMmyRxlSpRexa9xpfUqc4UWvWTUwY6YT2UUoPZUdovcdb8/vvzHUIalKldZ9UuMGO qn4slikBDxx9A7KUQXsoYOfLD0umGUdfKfPXWfZNY3D56iJJzJiLsatx8RopHd21q/pc mtptTL+QApVZmPag/DM9ImmFf+0GcjnYjwZW+Mov2w8od3RR6WPa0jf41IpnMMvhpUrl EBLilTIzluJtrY2kwV4piKsB2WJxvTqA1Cc3IeSNE3WtqDKyhUMhiaYyo5VgsfCBY0Yx K6fVI5GY3mWiQkL6VTxWmwq2SdN4ParwwVbbEFAw7HH/KYvmKZEZxV0euajw4tYS9x5p aOpQ== 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 g21si5601318edq.289.2019.10.19.01.29.35; Sat, 19 Oct 2019 01:29:58 -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 S2634182AbfJROlI (ORCPT + 99 others); Fri, 18 Oct 2019 10:41:08 -0400 Received: from mga18.intel.com ([134.134.136.126]:5096 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393962AbfJROlH (ORCPT ); Fri, 18 Oct 2019 10:41:07 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Oct 2019 07:41:07 -0700 X-IronPort-AV: E=Sophos;i="5.67,312,1566889200"; d="scan'208";a="186844268" Received: from tzanussi-mobl.amr.corp.intel.com (HELO [10.251.31.185]) ([10.251.31.185]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 18 Oct 2019 07:41:06 -0700 Subject: Re: [PATCH v2] tracing: fix "gfp_t" format for synthetic events To: Zhengjun Xing , rostedt@goodmis.org, mingo@redhat.com Cc: linux-kernel@vger.kernel.org References: <20191018012034.6404-1-zhengjun.xing@linux.intel.com> From: "Zanussi, Tom" Message-ID: <2207cdd0-d44c-1c12-001a-f93203d3ceca@linux.intel.com> Date: Fri, 18 Oct 2019 09:41:05 -0500 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20191018012034.6404-1-zhengjun.xing@linux.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/17/2019 8:20 PM, Zhengjun Xing wrote: > 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; > } > Reviewed-by: Tom Zanussi