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);