Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2760044pxu; Mon, 14 Dec 2020 10:12:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJx48i1LQx4XkUSkFPlvtrZT+k/5DwkGAVyfEZlZrXMJ/S7bNNN0K+WWa86XsKvs0HQSIFCr X-Received: by 2002:a17:906:c45a:: with SMTP id ck26mr23751249ejb.200.1607969558909; Mon, 14 Dec 2020 10:12:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607969558; cv=none; d=google.com; s=arc-20160816; b=WxhM5gSoyyLcA+BWZJPcEUalsllW2b3AjT0k6RzwrvYp+8VYI1Mop5mxQ9RifVNwxT uujLQ8pLrrg8WCDc4tDS7QKsGlj/3Y6FWOm+dThZSTz8Pjw7QfFQAOGMMX877+yH4Y6L jP7re5Hxl+oKFvoSigCQE+8vgYb9N7X06kaY7K/L003yTLDVwkXM234B8ck6VxnDksnJ cwHheazJJVJH9dPlhR2YJyrievpGZZF7IPp2OI6jt1pfloJ84+8jJDQn7sFs6yBufMNy +E6JXl0cv0dorVxvs8Sq0dTnbyIsQjEscExeVvjVN550cOgGKtswfzuLAWcgcCqXMDd1 SYeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:date:cc:to:from:subject :message-id:dkim-signature; bh=JezVwkcUvzbDeHvXSRBpUCVs/qIVAUJGi+DKg0XJKa8=; b=hVefS2ckH2zHaOk/PaSVlc1+H5axqgG31VgTGF6t8s8xoIxoCu2zZnMYbcYpIKD6No 2Jyk5NjS42kgNAO/apP8dN8yn7dWn3CEVaFEGMlKKUvKcB4E4YsdSR50cfs7qJ99bUQ6 jqnKhyapGxp3MaeV1EsFRxErHtmuGeqdbBkCi2hqFqZ2/nUKhl/lGtNdyOSYXIwvzsr9 g5+hbB9BO8DzCv1H833WQtR/7tWfq0Byf0PD8KosH1X5RuKOjiVZCretgYyw/q47sSR/ /EQ5Cem5uBGzF+xh9fuSH0/H3vZkPPD9dHbpiHqc87xTjNSwW/cll61AOmdGEG82lngb f0VQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=mXy18jyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i8si10872466edr.271.2020.12.14.10.12.09; Mon, 14 Dec 2020 10:12:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rajagiritech-edu-in.20150623.gappssmtp.com header.s=20150623 header.b=mXy18jyh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437004AbgLNQnE (ORCPT + 99 others); Mon, 14 Dec 2020 11:43:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726223AbgLNQnD (ORCPT ); Mon, 14 Dec 2020 11:43:03 -0500 Received: from mail-pf1-x42a.google.com (mail-pf1-x42a.google.com [IPv6:2607:f8b0:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACC09C0613D6 for ; Mon, 14 Dec 2020 08:42:23 -0800 (PST) Received: by mail-pf1-x42a.google.com with SMTP id 131so12373710pfb.9 for ; Mon, 14 Dec 2020 08:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rajagiritech-edu-in.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:user-agent:mime-version; bh=JezVwkcUvzbDeHvXSRBpUCVs/qIVAUJGi+DKg0XJKa8=; b=mXy18jyh6x9Yg5x/9PYmMAfeBUgoUAzxkI+cBR3uyWjLrqttklGNM7KuVM/9iipOZe VHQ9K2I6ui+Nj3uEYv48Btuq1yNGWExK39A4eceIf3RWrY/2FfHE34g5jtEc8X1z8u2r FCxIyX3B7DGQVYCT+4BP9UO9+umtNa23eqJHtlW/q0zeoOKQ/0DxmMIvZ2fdRB8cWKAo zQRJpywYzWIU73CiY+vAFhXTp0eLd9toXWU0aoQMAVANbcruQRWN692WWd5ZsRlqIU5b r15VUxXEoJG0qsMjChSfzd0P5vjMRjzn+8aS5kXhxmo4ig7DhvGcszGEmfLFcFA9d9zv eZNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:user-agent :mime-version; bh=JezVwkcUvzbDeHvXSRBpUCVs/qIVAUJGi+DKg0XJKa8=; b=nUItJkB716ChxsfNDomHHwNnQ15jgbDG4BnzQ/uUdO067CHoTily9tccVKYVRjBPTu DquCkW3LhAcXTtkqpK9yT+KcQ5+casEBMoyXuADhaBOTB564x1ePLEdqZzJAbQxfTCAB 1YtT3tmwa5SWdJ9onA78tqQ9SNDrSd1gwEdmwsV4Z5YaDyD2s5i0xsFQfdwY0eMsy/R/ sebgguGuAMXEIStlbSaOTXN+iCxCPNDnfGl4jbMmAJ26ZGxZboIkqNZl0XE3SRfPYToq f6Ep/oj6uHTFydMP+KvzC8fNKZIcNqG7b/r1qg/zGCMDObJgEqi4XbmYZhpDKrpCILJw nYjg== X-Gm-Message-State: AOAM532q4YRUVbpjgm+XlaKTqUgcWbJeuKVAPIm1ZTUCEodOo6FgHywO +0uafVMZdoxe3iyevvJdM4z7Mg== X-Received: by 2002:a62:3582:0:b029:19e:4935:bea2 with SMTP id c124-20020a6235820000b029019e4935bea2mr24381264pfa.34.1607964143127; Mon, 14 Dec 2020 08:42:23 -0800 (PST) Received: from [192.168.1.9] ([171.61.231.84]) by smtp.gmail.com with ESMTPSA id u12sm19496373pfn.88.2020.12.14.08.42.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Dec 2020 08:42:22 -0800 (PST) Message-ID: Subject: related to fixing depreciated api From: Jeffrin Jose T To: Shuah Khan Cc: "open list:KERNEL SELFTEST FRAMEWORK" , lkml Date: Mon, 14 Dec 2020 22:12:14 +0530 Content-Type: multipart/mixed; boundary="=-b+EomzCa5T42UxINaR95" User-Agent: Evolution 3.38.1-2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-b+EomzCa5T42UxINaR95 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit hello, i have worked on to fix depreciated api issue from tools/testing/selftests/intel_pstate/aerf.c i met with the following error related... --------------x------------------x-----------------> $pwd /home/jeffrin/UP/linux-kselftest/tools/testing/selftests/intel_pstate $make gcc -Wall -D_GNU_SOURCE aperf.c /home/jeffrin/UP/linux- kselftest/tools/testing/selftests/kselftest_harness.h /home/jeffrin/UP/linux-kselftest/tools/testing/selftests/kselftest.h - lm -o /home/jeffrin/UP/linux- kselftest/tools/testing/selftests/intel_pstate/aperf aperf.c: In function ‘main’: aperf.c:58:2: warning: ‘ftime’ is deprecated [-Wdeprecated- declarations] 58 | ftime(&before); | ^~~~~ In file included from aperf.c:9: /usr/include/x86_64-linux-gnu/sys/timeb.h:39:12: note: declared here 39 | extern int ftime (struct timeb *__timebuf) | ^~~~~ aperf.c:67:2: warning: ‘ftime’ is deprecated [-Wdeprecated- declarations] 67 | ftime(&after); | ^~~~~ In file included from aperf.c:9: /usr/include/x86_64-linux-gnu/sys/timeb.h:39:12: note: declared here 39 | extern int ftime (struct timeb *__timebuf) | ^~~~~ $ ----------------x---------------x----------------------> from ftime manual i found that it is depreciated... This function is deprecated, and will be removed in a future version of the GNU C library. Use clock_gettime(2) instead. now clock_gettime gives new data structure. struct timespec { time_t tv_sec; /* seconds */ long tv_nsec; /* nanoseconds */ }; i worked on with the new data structure and some errors that came along. typical final output looks good but values of runtime and typical frequency does not look normal during "sudo bash run.sh". output of "git diff" and a portion of output of "sudo bash run.sh". is attached. -- software engineer rajagiri school of engineering and technology - autonomous --=-b+EomzCa5T42UxINaR95 Content-Disposition: attachment; filename="diff-or.txt" Content-Type: text/plain; name="diff-or.txt"; charset="UTF-8" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3Rvb2xzL3Rlc3Rpbmcvc2VsZnRlc3RzL2ludGVsX3BzdGF0ZS9hcGVyZi5j IGIvdG9vbHMvdGVzdGluZy9zZWxmdGVzdHMvaW50ZWxfcHN0YXRlL2FwZXJmLmMKaW5kZXggZjZj ZDAzYTg3NDkzLi43ZTM1ZTc4NzJmMTYgMTAwNjQ0Ci0tLSBhL3Rvb2xzL3Rlc3Rpbmcvc2VsZnRl c3RzL2ludGVsX3BzdGF0ZS9hcGVyZi5jCisrKyBiL3Rvb2xzL3Rlc3Rpbmcvc2VsZnRlc3RzL2lu dGVsX3BzdGF0ZS9hcGVyZi5jCkBAIC02LDcgKzYsNyBAQAogI2luY2x1ZGUgPHN5cy90eXBlcy5o PgogI2luY2x1ZGUgPHN5cy9zdGF0Lmg+CiAjaW5jbHVkZSA8ZmNudGwuaD4KLSNpbmNsdWRlIDxz eXMvdGltZWIuaD4KKyNpbmNsdWRlIDx0aW1lLmg+CiAjaW5jbHVkZSA8c2NoZWQuaD4KICNpbmNs dWRlIDxlcnJuby5oPgogI2luY2x1ZGUgPHN0cmluZy5oPgpAQCAtMjIsMTAgKzIyLDEyIEBAIGlu dCBtYWluKGludCBhcmdjLCBjaGFyICoqYXJndikgewogCWxvbmcgbG9uZyB0c2MsIG9sZF90c2Ms IG5ld190c2M7CiAJbG9uZyBsb25nIGFwZXJmLCBvbGRfYXBlcmYsIG5ld19hcGVyZjsKIAlsb25n IGxvbmcgbXBlcmY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mXG4iLCAxLjAqdG90YWwvMTAw MDAwMCk7IAorCXByaW50ZigiZnJlcTogJTcuMGZcbiIsIHRzYyAvICgxLjAgKiBhcGVyZiAvMS4w ICogKG1wZXJmKSkgLyB0b3RhbCk7CiAJcmV0dXJuIDA7CiB9Cg== --=-b+EomzCa5T42UxINaR95 Content-Disposition: attachment; filename="shot.txt" Content-Type: text/plain; name="shot.txt"; charset="UTF-8" Content-Transfer-Encoding: base64 U2V0dGluZyBtYXhpbXVtIGZyZXF1ZW5jeSB0byA1MDAKbGF1bmNoaW5nIGFwZXJmIGxvYWQgb24g MApsYXVuY2hpbmcgYXBlcmYgbG9hZCBvbiAxCmxhdW5jaGluZyBhcGVyZiBsb2FkIG9uIDIKbGF1 bmNoaW5nIGFwZXJmIGxvYWQgb24gMwpzbGVlcGluZyBmb3IgNSBzZWNvbmRzCndhaXRpbmcgZm9y IGpvYiBpZCA3NTIxCnJ1blRpbWU6IDAuMDAKZnJlcTogICAgIGluZgpydW5UaW1lOiAwLjAwCmZy ZXE6ICAgICBpbmYKcnVuVGltZTogMC4wMApmcmVxOiAgICAgaW5mCnJ1blRpbWU6IDAuMDAKZnJl cTogICAgIGluZgp3YWl0aW5nIGZvciBqb2IgaWQgNzUyMgp3YWl0aW5nIGZvciBqb2IgaWQgNzUy Mwp3YWl0aW5nIGZvciBqb2IgaWQgNzUyNApTZXR0aW5nIG1heGltdW0gZnJlcXVlbmN5IHRvIDQw MApsYXVuY2hpbmcgYXBlcmYgbG9hZCBvbiAwCmxhdW5jaGluZyBhcGVyZiBsb2FkIG9uIDEKbGF1 bmNoaW5nIGFwZXJmIGxvYWQgb24gMgpsYXVuY2hpbmcgYXBlcmYgbG9hZCBvbiAzCnNsZWVwaW5n IGZvciA1IHNlY29uZHMKd2FpdGluZyBmb3Igam9iIGlkIDc1NDAKcnVuVGltZTogMC4wMApmcmVx OiAgICAgaW5mCnJ1blRpbWU6IDAuMDAKZnJlcTogICAgIGluZgpydW5UaW1lOiAwLjAw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AgMAkJICAweDQwMAkJMjMwMDAwCjExMDAJICAg ICAgMTEwMAkgICAgMAkJICAweDQwMAkJMjMwMDAwCjEwMDAJICAgICAgOTk5CSAgICAtMQkJICAw eDQwMAkJMjMwMDAwCjkwMAkgICAgICA5MDAJICAgIDAJCSAgMHg0MDAJCTIzMDAwMAo4MDAJICAg ICAgODAwCSAgICAwCQkgIDB4NDAwCQkyMzAwMDAKNzAwCSAgICAgIDcwMAkgICAgMAkJICAweDQw MAkJMjMwMDAwCjYwMAkgICAgICA2MDAJICAgIDAJCSAgMHg0MDAJCTIzMDAwMAo1MDAJICAgICAg NTAwCSAgICAwCQkgIDB4NDAwCQkyMzAwMDAKNDAwCSAgICAgIDQwMAkgICAgMAkJICAw --=-b+EomzCa5T42UxINaR95--