From patchwork Fri Jun 14 13:51:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10995559 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 B2B7B76 for ; Fri, 14 Jun 2019 13:51:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A3564205FD for ; Fri, 14 Jun 2019 13:51:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 97476286BC; Fri, 14 Jun 2019 13:51:24 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 31053286BC for ; Fri, 14 Jun 2019 13:51:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728682AbfFNNvY (ORCPT ); Fri, 14 Jun 2019 09:51:24 -0400 Received: from mail-eopbgr740080.outbound.protection.outlook.com ([40.107.74.80]:58880 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727922AbfFNNvX (ORCPT ); Fri, 14 Jun 2019 09:51:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xi6jJEzBQ4rRzKV1pJ9YZsCk1q4ArOLtdBUXB7BfjJE=; b=1aPxnHQU/h0kkrxbN9qA5fJqk903SLyWSaiNKDnXG+xG5TDEzN4FfEKK0TavJid3iqazZH649lmXlXB4ldSNQPXOFhPsvWqOuNrVryeyftpMuLM0kvUn+bwIYAgtAbM/YX3kqjmZcnagiEnkrAKihuYNTXQYM+AHmdcN2f/cpt8= Received: from SN4PR0501MB3903.namprd05.prod.outlook.com (10.167.142.151) by SN4PR0501MB3776.namprd05.prod.outlook.com (10.167.141.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.10; Fri, 14 Jun 2019 13:51:18 +0000 Received: from SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c]) by SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c%5]) with mapi id 15.20.1987.010; Fri, 14 Jun 2019 13:51:18 +0000 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" , Yordan Karadzhov Subject: [PATCH v2 1/3] kernel-shark: Fix a bug when plotting the last trace record Thread-Topic: [PATCH v2 1/3] kernel-shark: Fix a bug when plotting the last trace record Thread-Index: AQHVIrg9qFsnkSyWOkmuog2EgEAXgA== Date: Fri, 14 Jun 2019 13:51:18 +0000 Message-ID: <20190614135045.17223-2-ykaradzhov@vmware.com> References: <20190614135045.17223-1-ykaradzhov@vmware.com> In-Reply-To: <20190614135045.17223-1-ykaradzhov@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:2f::25) To SN4PR0501MB3903.namprd05.prod.outlook.com (2603:10b6:803:4d::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ykaradzhov@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [146.247.46.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 87e9f7a9-fdf8-4281-c60f-08d6f0cf6031 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:SN4PR0501MB3776; x-ms-traffictypediagnostic: SN4PR0501MB3776: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-forefront-prvs: 0068C7E410 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(136003)(366004)(396003)(199004)(189003)(26005)(478600001)(186003)(25786009)(386003)(6506007)(305945005)(53936002)(52116002)(102836004)(73956011)(76176011)(50226002)(66066001)(66946007)(6486002)(6436002)(68736007)(81166006)(107886003)(14454004)(1730700003)(66476007)(66556008)(81156014)(2351001)(8676002)(2906002)(64756008)(6512007)(66446008)(8936002)(36756003)(4326008)(5640700003)(54906003)(2616005)(476003)(11346002)(486006)(5660300002)(1076003)(71200400001)(7736002)(71190400001)(316002)(446003)(6116002)(99286004)(3846002)(86362001)(2501003)(256004)(14444005)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0501MB3776;H:SN4PR0501MB3903.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: OhU77DY+077WXWQ8QcNAz7DAHQAkTJpzZ1IvEfP5uT6/KYpuvK4nzOMPi1fDc+STLgqcDlaPMqCGuOgl1/oKg00N+sy1tUxI2SJDYICSxzgGNov87y8zmFARgHqE75EhsYxYuEFSHyTPKMPFaw9E8EU5ajSIS7tb+qdr70HE16SUeWGNb77xNHXTFVW5ZAB4a+mj6E7j1eORP8We1/LUmxx+MWWswTpy302uYx2xzsQhI1lizMWGLXrL3CBamiKdEexFWBWNeH/AUndo/+UVtx3BmDA9Ry9THdxqH5Y3xBU8uiXHNosgqO5oP5cJUYlo8emzzO2C4jWNR0RBq8t7IyVxQw5iR5vSp/tyf7v1HWaFZHIBTwepu2tmmm5sCCs1GI117NrLX0FHp0nj1EZd6b55LLirko9biBB7ZSen0bo= Content-ID: <299EE68D652F1B4EB4DC96DDDE8F67CC@namprd05.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 87e9f7a9-fdf8-4281-c60f-08d6f0cf6031 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2019 13:51:18.5203 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ykaradzhov@vmware.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0501MB3776 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On a first glance this patch may looks like reverting commit 9336dd6bcd38 (kernel-shark: Fix a bug in ksmodel_set_next_bin_edge()) The point is that for the last bin we want to increment its upper edge used when checking if the bin is empty, but we do not want to touch the lower edge time used by kshark_find_entry_by_time(). Fixes: 9336dd6bcd38 (kernel-shark: Fix a bug in ksmodel_set_next_bin_edge()) Signed-off-by: Yordan Karadzhov --- kernel-shark/src/libkshark-model.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c index 978cd70..0cac924 100644 --- a/kernel-shark/src/libkshark-model.c +++ b/kernel-shark/src/libkshark-model.c @@ -260,20 +260,30 @@ static size_t ksmodel_set_upper_edge(struct kshark_trace_histo *histo) static void ksmodel_set_next_bin_edge(struct kshark_trace_histo *histo, size_t bin, size_t last_row) { - size_t time, next_bin = bin + 1; + size_t time_min, time_max, next_bin = bin + 1; ssize_t row; - /* Calculate the beginning of the next bin. */ - time = histo->min + next_bin * histo->bin_size; + /* Calculate the beginning and the end of the next bin. */ + time_min = histo->min + next_bin * histo->bin_size; + time_max = time_min + histo->bin_size; + /* + * The timestamp of the very last entry of the dataset can be exactly + * equal to the value of the upper edge of the range. This is very + * likely to happen when we use ksmodel_set_in_range_bining(). In this + * case we have to increase the size of the very last bin in order to + * make sure that the last entry of the dataset will fall into it. + */ + if (next_bin == histo->n_bins - 1) + ++time_max; /* * Find the index of the first entry inside - * the next bin (timestamp > time). + * the next bin (timestamp > time_min). */ - row = kshark_find_entry_by_time(time, histo->data, last_row, + row = kshark_find_entry_by_time(time_min, histo->data, last_row, histo->data_size - 1); - if (row < 0 || histo->data[row]->ts >= time + histo->bin_size) { + if (row < 0 || histo->data[row]->ts >= time_max) { /* The bin is empty. */ histo->map[next_bin] = KS_EMPTY_BIN; return; From patchwork Fri Jun 14 13:51:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10995563 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 68DA81515 for ; Fri, 14 Jun 2019 13:51:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59724285EA for ; Fri, 14 Jun 2019 13:51:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4DB7D286C6; Fri, 14 Jun 2019 13:51:26 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E769C2833E for ; Fri, 14 Jun 2019 13:51:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727922AbfFNNvZ (ORCPT ); Fri, 14 Jun 2019 09:51:25 -0400 Received: from mail-eopbgr740080.outbound.protection.outlook.com ([40.107.74.80]:58880 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728669AbfFNNvZ (ORCPT ); Fri, 14 Jun 2019 09:51:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=CjHFxpsMkBgKgX3RWkgiIBJwJ5QU+m1aMhGR9yG5ZaE=; b=aUc4mYYK3P4CNPBk8+5PI4FgbjGXMVzyjDLIHwgIh4hBs4ocQJu/AMY0h1aPbWgQNkoL2KEUpLNag1ITISImeW3whKi5OVwUQgrr/F6uEOmwwyRl0JXKg8GdHcaO2B9/eBnssBR21uEDQlIMx4qP6GQs7X87H/Owut+W21tu/d8= Received: from SN4PR0501MB3903.namprd05.prod.outlook.com (10.167.142.151) by SN4PR0501MB3776.namprd05.prod.outlook.com (10.167.141.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.10; Fri, 14 Jun 2019 13:51:21 +0000 Received: from SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c]) by SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c%5]) with mapi id 15.20.1987.010; Fri, 14 Jun 2019 13:51:21 +0000 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" , Yordan Karadzhov , Alan Mikhak Subject: [PATCH v2 2/3] kernel-shark: Always use 64 bit variables for timestamps. Thread-Topic: [PATCH v2 2/3] kernel-shark: Always use 64 bit variables for timestamps. Thread-Index: AQHVIrg/67Or2OkgMUSl0XfK/lALJw== Date: Fri, 14 Jun 2019 13:51:20 +0000 Message-ID: <20190614135045.17223-3-ykaradzhov@vmware.com> References: <20190614135045.17223-1-ykaradzhov@vmware.com> In-Reply-To: <20190614135045.17223-1-ykaradzhov@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:2f::25) To SN4PR0501MB3903.namprd05.prod.outlook.com (2603:10b6:803:4d::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ykaradzhov@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [146.247.46.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 503b80ad-5745-424e-68f5-08d6f0cf6183 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:SN4PR0501MB3776; x-ms-traffictypediagnostic: SN4PR0501MB3776: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-forefront-prvs: 0068C7E410 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(136003)(366004)(396003)(199004)(189003)(26005)(478600001)(186003)(25786009)(386003)(6506007)(305945005)(53936002)(52116002)(102836004)(73956011)(76176011)(50226002)(66066001)(66946007)(6486002)(6436002)(68736007)(81166006)(14454004)(1730700003)(66476007)(66556008)(81156014)(2351001)(8676002)(2906002)(64756008)(6512007)(66446008)(8936002)(36756003)(4326008)(5640700003)(54906003)(2616005)(476003)(11346002)(486006)(5660300002)(1076003)(71200400001)(7736002)(71190400001)(316002)(446003)(6116002)(99286004)(3846002)(86362001)(2501003)(256004)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0501MB3776;H:SN4PR0501MB3903.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: uO4uFMg6emLhZhjCZWVvTW382n9nH28J2H1c1MUagymq1fAMb2COqryByav4qvObX2W6ASrmrPh66TaUZqye6onZUVKHejH3TvKJPw4NeBA6I8cXAkMdrAh+rSXO5pZXkhjLU4W5u64kJcmOSCJsdCsiLFg6NZCv4pLgcUBk4OTz1bvRs6IQbrQPISqZGfaH7QT1rt4oJE4w3+4ktHZiVkArAaeLuXcMubUvgLkLb8g065ZospQ1vZeTxLuu0q0a1qzE6k1dICdtUvF2/w7sk0p12/elKlzR4Zkxe3SiKsG/khdOFs8oMfr2yU3ZDGsto9JIIIaL9KB1s015ImoENkObuuCEd8SW54EHBPV0DHqqZLQTNbw10ICOcDWycTckKtyTXlOz9b0fFQkQy5i5Z9d/OjUnrqxAnmb8oG7+nWI= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: 503b80ad-5745-424e-68f5-08d6f0cf6183 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2019 13:51:20.7750 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ykaradzhov@vmware.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0501MB3776 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All time stamps of the trace records are coded with 64 bits, however on some systems the size_t type can be 32 bits. Reported-by: Alan Mikhak Signed-off-by: Yordan Karadzhov --- kernel-shark/src/libkshark-model.c | 7 ++++--- kernel-shark/src/libkshark-model.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/kernel-shark/src/libkshark-model.c b/kernel-shark/src/libkshark-model.c index 0cac924..18f9c69 100644 --- a/kernel-shark/src/libkshark-model.c +++ b/kernel-shark/src/libkshark-model.c @@ -260,7 +260,8 @@ static size_t ksmodel_set_upper_edge(struct kshark_trace_histo *histo) static void ksmodel_set_next_bin_edge(struct kshark_trace_histo *histo, size_t bin, size_t last_row) { - size_t time_min, time_max, next_bin = bin + 1; + uint64_t time_min, time_max; + size_t next_bin = bin + 1; ssize_t row; /* Calculate the beginning and the end of the next bin. */ @@ -601,9 +602,9 @@ void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n) * @param histo: Input location for the model descriptor. * @param ts: position in time to be visualized. */ -void ksmodel_jump_to(struct kshark_trace_histo *histo, size_t ts) +void ksmodel_jump_to(struct kshark_trace_histo *histo, uint64_t ts) { - size_t min, max, range_min; + uint64_t min, max, range_min; if (ts > histo->min && ts < histo->max) { /* diff --git a/kernel-shark/src/libkshark-model.h b/kernel-shark/src/libkshark-model.h index 95c30b6..47793b1 100644 --- a/kernel-shark/src/libkshark-model.h +++ b/kernel-shark/src/libkshark-model.h @@ -89,7 +89,7 @@ void ksmodel_shift_forward(struct kshark_trace_histo *histo, size_t n); void ksmodel_shift_backward(struct kshark_trace_histo *histo, size_t n); -void ksmodel_jump_to(struct kshark_trace_histo *histo, size_t ts); +void ksmodel_jump_to(struct kshark_trace_histo *histo, uint64_t ts); void ksmodel_zoom_out(struct kshark_trace_histo *histo, double r, int mark); From patchwork Fri Jun 14 13:51:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yordan Karadzhov X-Patchwork-Id: 10995565 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 EDF1614E5 for ; Fri, 14 Jun 2019 13:51:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF628286B9 for ; Fri, 14 Jun 2019 13:51:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D3BBE286BC; Fri, 14 Jun 2019 13:51:31 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6AFFF285EA for ; Fri, 14 Jun 2019 13:51:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728391AbfFNNvb (ORCPT ); Fri, 14 Jun 2019 09:51:31 -0400 Received: from mail-eopbgr770042.outbound.protection.outlook.com ([40.107.77.42]:53892 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728239AbfFNNva (ORCPT ); Fri, 14 Jun 2019 09:51:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YvkPkRN+qDakYbW28IDF+CmCPjGyRYG1bOmdPYc/t08=; b=N/39bgwi99dycy7tXkBzMU+ZZmlkh2tTVTTUp4FTKZqaT2hbI6DDZxAjPSCqeCUQ2UXhnyMuL+FN7vVr5FKGEdDlFsjQm90D5ONvYgS6bFiO85TB4VSc+pecpAHkrvAlWVFov6ZrU7JTlBn09wA19tKX6cdbki8sVx7AfKc+Q/U= Received: from SN4PR0501MB3903.namprd05.prod.outlook.com (10.167.142.151) by SN4PR0501MB3776.namprd05.prod.outlook.com (10.167.141.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1987.10; Fri, 14 Jun 2019 13:51:23 +0000 Received: from SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c]) by SN4PR0501MB3903.namprd05.prod.outlook.com ([fe80::d0ff:f109:af39:2c9c%5]) with mapi id 15.20.1987.010; Fri, 14 Jun 2019 13:51:23 +0000 From: Yordan Karadzhov To: "rostedt@goodmis.org" CC: "linux-trace-devel@vger.kernel.org" , Yordan Karadzhov , Alan Mikhak Subject: [PATCH v2 3/3] kernel-shark: Fix all warnings when building on 32 bit systems Thread-Topic: [PATCH v2 3/3] kernel-shark: Fix all warnings when building on 32 bit systems Thread-Index: AQHVIrhAzN+GJnvWF02wC+wct2bLxw== Date: Fri, 14 Jun 2019 13:51:23 +0000 Message-ID: <20190614135045.17223-4-ykaradzhov@vmware.com> References: <20190614135045.17223-1-ykaradzhov@vmware.com> In-Reply-To: <20190614135045.17223-1-ykaradzhov@vmware.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: DB6P190CA0012.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:2f::25) To SN4PR0501MB3903.namprd05.prod.outlook.com (2603:10b6:803:4d::23) authentication-results: spf=none (sender IP is ) smtp.mailfrom=ykaradzhov@vmware.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.20.1 x-originating-ip: [146.247.46.5] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: c567bf05-b5c3-4bcc-04e1-08d6f0cf62fb x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020);SRVR:SN4PR0501MB3776; x-ms-traffictypediagnostic: SN4PR0501MB3776: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:71; x-forefront-prvs: 0068C7E410 x-forefront-antispam-report: SFV:NSPM;SFS:(10009020)(39860400002)(376002)(346002)(136003)(366004)(396003)(199004)(189003)(26005)(478600001)(186003)(25786009)(386003)(6506007)(305945005)(53936002)(52116002)(102836004)(73956011)(76176011)(50226002)(66066001)(66946007)(6486002)(6436002)(68736007)(81166006)(14454004)(1730700003)(66476007)(66556008)(81156014)(2351001)(8676002)(2906002)(64756008)(6512007)(66446008)(8936002)(36756003)(4326008)(5640700003)(54906003)(2616005)(476003)(11346002)(486006)(5660300002)(1076003)(71200400001)(7736002)(71190400001)(316002)(446003)(6116002)(99286004)(3846002)(86362001)(2501003)(256004)(6916009);DIR:OUT;SFP:1101;SCL:1;SRVR:SN4PR0501MB3776;H:SN4PR0501MB3903.namprd05.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: +oSHfSmG9LqR+ALq+VoHSkszRCohss6n9ooEuljIVUWuJKUzg+HAM2hJiLT8uJe2Ha6CgQaExdJZd+caNUUck4AJh2pILIrZMqlOFAG4TNLol6UihXpRce7bgQNORmi1IdZoeW+LjetuwX7LYj6MY3l/b56zcri5Xdo6KPS9Tb4xkfjY6anyRKz48xsSnpqk/M6ceGYx6DU5gViqzgnL3/OIuhtCayvLAWoQwIQfnOMlAy4HTYbGhkxEp21yfxogJyl9ghK921UWXc0+dMCFY5mcLyQJ9aDh0FvUDpY+zxl0NUs9I1tEKdahdjNx7pW/WICNHonIzfdwXhhLS6ou3Bc53JM1sSe0YwTXKUpsR7KkghJl7FFGmKusil4LuBb4jF2U6DdIvPhI9ZkN2D5Nia8zIaC50ie7Mpnx9q0xEuE= Content-ID: MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-Network-Message-Id: c567bf05-b5c3-4bcc-04e1-08d6f0cf62fb X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Jun 2019 13:51:23.2086 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ykaradzhov@vmware.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0501MB3776 Sender: linux-trace-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-trace-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixing warnings coming from: ../examples/datahisto.c ../src/KsTraceGraph.cpp ../src/libkshark.c Reported-by: Alan Mikhak Signed-off-by: Yordan Karadzhov --- kernel-shark/examples/datahisto.c | 4 ++-- kernel-shark/src/KsTraceGraph.cpp | 10 +++++----- kernel-shark/src/libkshark.c | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/kernel-shark/examples/datahisto.c b/kernel-shark/examples/datahisto.c index 02c6285..b177b08 100644 --- a/kernel-shark/examples/datahisto.c +++ b/kernel-shark/examples/datahisto.c @@ -56,11 +56,11 @@ void dump_bin(struct kshark_trace_histo *histo, int bin, puts ("EMPTY BIN"); } else { entry_str = kshark_dump_entry(e_front); - printf("%li -> %s\n", i_front, entry_str); + printf("%zd -> %s\n", i_front, entry_str); free(entry_str); entry_str = kshark_dump_entry(e_back); - printf("%li -> %s\n", i_back, entry_str); + printf("%zd -> %s\n", i_back, entry_str); free(entry_str); } diff --git a/kernel-shark/src/KsTraceGraph.cpp b/kernel-shark/src/KsTraceGraph.cpp index da2c6aa..324f36e 100644 --- a/kernel-shark/src/KsTraceGraph.cpp +++ b/kernel-shark/src/KsTraceGraph.cpp @@ -277,7 +277,7 @@ void KsTraceGraph::_resetPointer(uint64_t ts, int cpu, int pid) QString pointer; kshark_convert_nano(ts, &sec, &usec); - pointer.sprintf("%lu.%06lu", sec, usec); + pointer.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec); _labelP2.setText(pointer); if (pid > 0 && cpu >= 0) { @@ -313,7 +313,7 @@ void KsTraceGraph::_setPointerInfo(size_t i) uint64_t sec, usec; kshark_convert_nano(e->ts, &sec, &usec); - pointer.sprintf("%lu.%06lu", sec, usec); + pointer.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec); _labelP2.setText(pointer); comm.append("-"); @@ -601,17 +601,17 @@ void KsTraceGraph::_updateTimeLegends() QString tMin, tMid, tMax; kshark_convert_nano(_glWindow.model()->histo()->min, &sec, &usec); - tMin.sprintf("%lu.%06lu", sec, usec); + tMin.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec); _labelXMin.setText(tMin); tsMid = (_glWindow.model()->histo()->min + _glWindow.model()->histo()->max) / 2; kshark_convert_nano(tsMid, &sec, &usec); - tMid.sprintf("%lu.%06lu", sec, usec); + tMid.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec); _labelXMid.setText(tMid); kshark_convert_nano(_glWindow.model()->histo()->max, &sec, &usec); - tMax.sprintf("%lu.%06lu", sec, usec); + tMax.sprintf("%" PRIu64 ".%06" PRIu64 "", sec, usec); _labelXMax.setText(tMax); } diff --git a/kernel-shark/src/libkshark.c b/kernel-shark/src/libkshark.c index 0f0a1ba..9aaf1b7 100644 --- a/kernel-shark/src/libkshark.c +++ b/kernel-shark/src/libkshark.c @@ -1423,7 +1423,7 @@ char* kshark_dump_custom_entry(struct kshark_context *kshark_ctx, event_name = info_func(kshark_ctx, entry, false); info = info_func(kshark_ctx, entry, true); - size = asprintf(&entry_str, "%li; %s-%i; CPU %i; ; %s; %s", + size = asprintf(&entry_str, "%" PRIu64 "; %s-%i; CPU %i; ; %s; %s", entry->ts, task, entry->pid, @@ -1472,7 +1472,7 @@ char* kshark_dump_entry(const struct kshark_entry *entry) event_name = event? event->name : "[UNKNOWN EVENT]"; lat = kshark_get_latency(kshark_ctx->pevent, data); - size = asprintf(&temp_str, "%li; %s-%i; CPU %i; %s;", + size = asprintf(&temp_str, "%" PRIu64 "; %s-%i; CPU %i; %s;", entry->ts, task, entry->pid,