From patchwork Wed Aug 29 12:17:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" X-Patchwork-Id: 10580231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 60C2B174A for ; Wed, 29 Aug 2018 12:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 517012B014 for ; Wed, 29 Aug 2018 12:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 461002B016; Wed, 29 Aug 2018 12:42:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CF1602B014 for ; Wed, 29 Aug 2018 12:42:43 +0000 (UTC) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 1853FD70; Wed, 29 Aug 2018 12:36:52 +0000 (UTC) X-Original-To: ltsi-dev@lists.linuxfoundation.org Delivered-To: ltsi-dev@mail.linuxfoundation.org Received: from smtp2.linuxfoundation.org (smtp2.linux-foundation.org [172.17.192.36]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 8BCFDD5D for ; Wed, 29 Aug 2018 12:36:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mx06.melco.co.jp (mx06.melco.co.jp [192.218.140.146]) by smtp2.linuxfoundation.org (Postfix) with ESMTPS id BB3F71DD99 for ; Wed, 29 Aug 2018 12:36:40 +0000 (UTC) Received: from mr06.melco.co.jp (mr06 [133.141.98.164]) by mx06.melco.co.jp (Postfix) with ESMTP id AFFFE3A2E9D for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mr06.melco.co.jp (unknown [127.0.0.1]) by mr06.imss (Postfix) with ESMTP id 420l4T4grkzRkBT for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mf04_second.melco.co.jp (unknown [192.168.20.184]) by mr06.melco.co.jp (Postfix) with ESMTP id 420l4T4N9rzRk5W for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from mf04.melco.co.jp (unknown [133.141.98.184]) by mf04_second.melco.co.jp (Postfix) with ESMTP id 420l4T4k5VzRkCw for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) Received: from JPN01-OS2-obe.outbound.protection.outlook.com (unknown [23.103.139.143]) by mf04.melco.co.jp (Postfix) with ESMTP id 420l4T4FXPzRkCn for ; Wed, 29 Aug 2018 21:17:29 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mitsubishielectricgroup.onmicrosoft.com; s=selector1-mitsubishielectricgroup-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JuqCjwS9zXRVxK1D3GDyhvrY9LYeBIP33f/0NAX2Y+k=; b=kUUAbCQPE1PXc7KSDJKMac3vaP+Sey7uo1MHqLCFYAUZcvuPhyFST8rCwnybcZ1IwUJkGGPc87eFsdpSIw+oExXarnLXrCIWm2G3gWwYdXm8fsEk63k/g8Vxem0qIi54/9RdE6xh4VfdbgM6dLDO7imfAmH3Y0n4t9GDMmZEXEs= Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com (52.133.160.145) by TY1PR01MB1708.jpnprd01.prod.outlook.com (52.133.160.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.15; Wed, 29 Aug 2018 12:17:29 +0000 Received: from TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa]) by TY1PR01MB1692.jpnprd01.prod.outlook.com ([fe80::d04e:e6f6:c782:22fa%2]) with mapi id 15.20.1080.015; Wed, 29 Aug 2018 12:17:29 +0000 From: "Motai.Hirotaka@aj.MitsubishiElectric.co.jp" To: "ltsi-dev@lists.linuxfoundation.org" Thread-Topic: [LTSI-dev] [PATCH 22/54] tracing: Move get_hist_field_flags() Thread-Index: AdQ/i6IjpO5sCBTqQ22CuCv9ogK8Ig== Date: Wed, 29 Aug 2018 12:17:07 +0000 Deferred-Delivery: Wed, 29 Aug 2018 12:15:00 +0000 Message-ID: Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-melpop: 1 authentication-results: spf=none (sender IP is ) smtp.mailfrom=Motai.Hirotaka@aj.MitsubishiElectric.co.jp; x-originating-ip: [153.231.200.201] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; TY1PR01MB1708; 6:TtEdhVBZKzEd5AuX0kjFfRqu+jBhOQt6+X8AqAITXcEflyBFX0/T72pGQGHAJuunzVyuYjG2D1DBLyZLL9xi0zM8mdymTy6pYHUQgvFKa2TDIJJ+gjP/qtKWChCJGueKR4/NvU6tj9ns6uT5XO/WDFdi8VSfIJFgdencskWspOCrsVe0QXALE1jVV5s8VH3W65Pkuu2q9SS1fIvwCv/jEP9VQyayjsNcI+B3RtP5XNIbgyzkV5zmipI/6qoZrzMtn3r/lJkOOLfHdVd4IB4dbVhqjtZ3nKvldgzeb0rRdzhdmhmIHXD+TFdThGdjEnN4TXUbWGANNU+34i5UZaW+fyxikbGzSm4LlsWxoJ2Vrr02j3EW/nr1px2FalrohytBKk5lzLGgpJAiujUSf9LQFuXGw7+YpqiE3Gn02cvEOV4o0Mjmlndn6zVpUZAvfQbT1AKujSu/RgrWufZPx5GC/w==; 5:YS7w10sDMBzlj2TcO6BoHXZ7GSgpwqBYT4onEi1ZXFjprCXnjQp5G49dMVZrmSwsT9Drah0bLS9KSZGiLnBEUHP8me//+WlaCFLzZeS8HXVHVO8qc4+qPIesJHepepUA7SsYDNlntuTlQ2AQZqdz7Nprz5c9BREDTaarWiVCHB0=; 7:g9lIVJ49PhoLVJNmmkCzP3jm4rpH1V2Q7dwn+CE+xcfiYScwDV4ALHAvfTtEsOvuAVAJRzAK4XS4x5wmvGZU0TEi6evwYA+xCmWtQzXgYvxG29fikFmUGxT5gnUvCrY+PB6baxLH66Qz6JcPF3vL80JstOoVioCeyX6j/woo0Sa4DJ05hMh8c71ALT/KhQz5XQa4ckyn7l+T8oFqz/0tXEHlyrnH45SbWHdnxVe0KtCNDt2fk2Pz1Jlryu2Vvq1Z x-ms-office365-filtering-correlation-id: 6e92d774-a7ac-48fe-35c3-08d60da9638d x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:TY1PR01MB1708; x-ms-traffictypediagnostic: TY1PR01MB1708: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(42068640409301)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231311)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699016); SRVR:TY1PR01MB1708; BCL:0; PCL:0; RULEID:; SRVR:TY1PR01MB1708; x-forefront-prvs: 077929D941 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(136003)(366004)(396003)(39860400002)(346002)(376002)(189003)(199004)(966005)(25786009)(74482002)(81156014)(8676002)(106356001)(5660300001)(105586002)(6506007)(14454004)(81166006)(33656002)(26005)(7736002)(74316002)(186003)(72206003)(305945005)(66066001)(68736007)(97736004)(478600001)(476003)(102836004)(2906002)(8936002)(6666003)(6916009)(486006)(6116002)(1857600001)(316002)(7696005)(2900100001)(5640700003)(3846002)(55016002)(99286004)(53936002)(86362001)(256004)(6436002)(6306002)(2501003)(5250100002)(9686003)(575784001)(2351001); DIR:OUT; SFP:1102; SCL:1; SRVR:TY1PR01MB1708; H:TY1PR01MB1692.jpnprd01.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:0; received-spf: None (protection.outlook.com: aj.MitsubishiElectric.co.jp does not designate permitted sender hosts) x-microsoft-antispam-message-info: pi/U8BC2JvTQJ+QeSPORZbU+ucwianKBQYgbrDHlHTK7YTcWCuUdGaKBMVuLIgVL/MsmAzt5UzIAG0nhV0cbp+YWEJLBXQdWZlyhsTp8xN6qgFM8/EBN9gWdHl38l/Ncrh0aMC/OqNfkpiNknZokPKQnIygNvDhkNKiQ0YYaAXS4hEFO8Zym7bLYjpCD656L+a0GFmvu8x5ZKfbBQM0HiHeW7Hp8otKNdlHj+f2l6wKkO2BtbURO5Cp0YktmDlns88zOyNsdQv/eEgQnJQ2mCchOKs8Xe44fWFWxBNoyaocnTDmKD2PRAnTrSSjDjGrcYemX9kUX/dRseaGgNauW0TTa3x9VOcslfULY+QlTjeQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: aj.MitsubishiElectric.co.jp X-MS-Exchange-CrossTenant-Network-Message-Id: 6e92d774-a7ac-48fe-35c3-08d60da9638d X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Aug 2018 12:17:22.6357 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: c5a75b62-4bff-4c96-a720-6621ce9978e5 X-MS-Exchange-Transport-CrossTenantHeadersStamped: TY1PR01MB1708 Subject: [LTSI-dev] [PATCH 22/54] tracing: Move get_hist_field_flags() X-BeenThere: ltsi-dev@lists.linuxfoundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "A list to discuss patches, development, and other things related to the LTSI project" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ltsi-dev-bounces@lists.linuxfoundation.org Errors-To: ltsi-dev-bounces@lists.linuxfoundation.org X-Virus-Scanned: ClamAV using ClamSMTP Move get_hist_field_flags() to make it more easily accessible for new code (and keep the move separate from new functionality). Link: http://lkml.kernel.org/r/32470f0a7047ec7a6e84ba5ec89d6142cc6ede7d.1516069914.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi Signed-off-by: Steven Rostedt (VMware) (cherry picked from commit 2ece94fbd25c70543dd073d10569e08c3e3b4a7f) Signed-off-by: Hirotaka MOTAI --- kernel/trace/trace_events_hist.c | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/kernel/trace/trace_events_hist.c b/kernel/trace/trace_events_hist.c index ba326260..a81a709d 100644 --- a/kernel/trace/trace_events_hist.c +++ b/kernel/trace/trace_events_hist.c @@ -492,16 +492,38 @@ static void hist_trigger_elt_comm_init(struct tracing_map_elt *elt) } static const struct tracing_map_ops hist_trigger_elt_comm_ops = { .elt_alloc = hist_trigger_elt_comm_alloc, .elt_free = hist_trigger_elt_comm_free, .elt_init = hist_trigger_elt_comm_init, }; +static const char *get_hist_field_flags(struct hist_field *hist_field) +{ + const char *flags_str = NULL; + + if (hist_field->flags & HIST_FIELD_FL_HEX) + flags_str = "hex"; + else if (hist_field->flags & HIST_FIELD_FL_SYM) + flags_str = "sym"; + else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) + flags_str = "sym-offset"; + else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) + flags_str = "execname"; + else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) + flags_str = "syscall"; + else if (hist_field->flags & HIST_FIELD_FL_LOG2) + flags_str = "log2"; + else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) + flags_str = "usecs"; + + return flags_str; +} + static void destroy_hist_field(struct hist_field *hist_field, unsigned int level) { unsigned int i; if (level > 2) return; @@ -1490,38 +1512,16 @@ static int event_hist_open(struct inode *inode, struct file *file) const struct file_operations event_hist_fops = { .open = event_hist_open, .read = seq_read, .llseek = seq_lseek, .release = single_release, }; -static const char *get_hist_field_flags(struct hist_field *hist_field) -{ - const char *flags_str = NULL; - - if (hist_field->flags & HIST_FIELD_FL_HEX) - flags_str = "hex"; - else if (hist_field->flags & HIST_FIELD_FL_SYM) - flags_str = "sym"; - else if (hist_field->flags & HIST_FIELD_FL_SYM_OFFSET) - flags_str = "sym-offset"; - else if (hist_field->flags & HIST_FIELD_FL_EXECNAME) - flags_str = "execname"; - else if (hist_field->flags & HIST_FIELD_FL_SYSCALL) - flags_str = "syscall"; - else if (hist_field->flags & HIST_FIELD_FL_LOG2) - flags_str = "log2"; - else if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP_USECS) - flags_str = "usecs"; - - return flags_str; -} - static void hist_field_print(struct seq_file *m, struct hist_field *hist_field) { const char *field_name = hist_field_name(hist_field, 0); if (hist_field->var.name) seq_printf(m, "%s=", hist_field->var.name); if (hist_field->flags & HIST_FIELD_FL_TIMESTAMP)