linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* related to fixing  depreciated  api
@ 2020-12-14 16:42 Jeffrin Jose T
  2020-12-15 13:05 ` [WARNING ]Re: " Jeffrin Thalakkottoor
  2020-12-15 16:12 ` Shuah Khan
  0 siblings, 2 replies; 5+ messages in thread
From: Jeffrin Jose T @ 2020-12-14 16:42 UTC (permalink / raw)
  To: Shuah Khan; +Cc: open list:KERNEL SELFTEST FRAMEWORK, lkml

[-- Attachment #1: Type: text/plain, Size: 1977 bytes --]

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



[-- Attachment #2: diff-or.txt --]
[-- Type: text/plain, Size: 2317 bytes --]

diff --git a/tools/testing/selftests/intel_pstate/aperf.c b/tools/testing/selftests/intel_pstate/aperf.c
index f6cd03a87493..7e35e7872f16 100644
--- a/tools/testing/selftests/intel_pstate/aperf.c
+++ b/tools/testing/selftests/intel_pstate/aperf.c
@@ -6,7 +6,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/timeb.h>
+#include <time.h>
 #include <sched.h>
 #include <errno.h>
 #include <string.h>
@@ -22,10 +22,12 @@ int main(int argc, char **argv) {
 	long long tsc, old_tsc, new_tsc;
 	long long aperf, old_aperf, new_aperf;
 	long long mperf, old_mperf, new_mperf;
-	struct timeb before, after;
+	struct timespec before, after;
+        clockid_t clkid;
 	long long int start, finish, total;
 	cpu_set_t cpuset;
 
+
 	if (argc != 2) {
 		usage(argv[0]);
 		return 1;
@@ -41,6 +43,10 @@ int main(int argc, char **argv) {
 
 	sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu);
 	fd = open(msr_file_name, O_RDONLY);
+        #define CLOCKFD 3
+        #define FD_TO_CLOCKID(fd)   ((~(clockid_t) (fd) << 3) | CLOCKFD)
+        clkid = FD_TO_CLOCKID(fd);
+
 
 	if (fd == -1) {
 		printf("/dev/cpu/%d/msr: %s\n", cpu, strerror(errno));
@@ -55,7 +61,7 @@ int main(int argc, char **argv) {
 		return 1;
 	}
 
-	ftime(&before);
+	clock_gettime(clkid,&before);
 	pread(fd, &old_tsc,  sizeof(old_tsc), 0x10);
 	pread(fd, &old_aperf,  sizeof(old_mperf), 0xe7);
 	pread(fd, &old_mperf,  sizeof(old_aperf), 0xe8);
@@ -64,7 +70,7 @@ int main(int argc, char **argv) {
 		sqrt(i);
 	}
 
-	ftime(&after);
+	clock_gettime(clkid,&after);
 	pread(fd, &new_tsc,  sizeof(new_tsc), 0x10);
 	pread(fd, &new_aperf,  sizeof(new_mperf), 0xe7);
 	pread(fd, &new_mperf,  sizeof(new_aperf), 0xe8);
@@ -73,11 +79,10 @@ int main(int argc, char **argv) {
 	aperf = new_aperf-old_aperf;
 	mperf = new_mperf-old_mperf;
 
-	start = before.time*1000 + before.millitm;
-	finish = after.time*1000 + after.millitm;
-	total = finish - start;
-
-	printf("runTime: %4.2f\n", 1.0*total/1000);
-	printf("freq: %7.0f\n", tsc / (1.0*aperf / (1.0 * mperf)) / total);
+	start = before.tv_sec*1000000 + before.tv_nsec;
+	finish = after.tv_sec*1000000 + after.tv_nsec;
+	total = finish - start; 
+	printf("runTime: %4.2f\n", 1.0*total/1000000); 
+	printf("freq: %7.0f\n", tsc / (1.0 * aperf /1.0 * (mperf)) / total);
 	return 0;
 }

[-- Attachment #3: shot.txt --]
[-- Type: text/plain, Size: 1761 bytes --]

Setting maximum frequency to 500
launching aperf load on 0
launching aperf load on 1
launching aperf load on 2
launching aperf load on 3
sleeping for 5 seconds
waiting for job id 7521
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
waiting for job id 7522
waiting for job id 7523
waiting for job id 7524
Setting maximum frequency to 400
launching aperf load on 0
launching aperf load on 1
launching aperf load on 2
launching aperf load on 3
sleeping for 5 seconds
waiting for job id 7540
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
waiting for job id 7541
runTime: 0.00
freq:     inf
waiting for job id 7542
waiting for job id 7543
========================================================================
The marketing frequency of the cpu is 2300 MHz
The maximum frequency of the cpu is 2300 MHz
The minimum frequency of the cpu is 400 MHz
Target	      Actual	    Difference	  MSR(0x199)	max_perf_pct
2300	      2300	    0		  0x400		230000
2200	      2200	    0		  0x400		230000
2100	      2100	    0		  0x400		230000
2000	      2000	    0		  0x400		230000
1900	      1900	    0		  0x400		230000
1800	      1800	    0		  0x400		230000
1700	      1700	    0		  0x400		230000
1600	      1600	    0		  0x400		230000
1500	      1500	    0		  0x400		230000
1400	      1400	    0		  0x400		230000
1300	      1300	    0		  0x400		230000
1200	      1200	    0		  0x400		230000
1100	      1100	    0		  0x400		230000
1000	      999	    -1		  0x400		230000
900	      900	    0		  0x400		230000
800	      800	    0		  0x400		230000
700	      700	    0		  0x400		230000
600	      600	    0		  0x400		230000
500	      500	    0		  0x400		230000
400	      400	    0		  0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [WARNING ]Re: related to fixing depreciated api
  2020-12-14 16:42 related to fixing depreciated api Jeffrin Jose T
@ 2020-12-15 13:05 ` Jeffrin Thalakkottoor
  2020-12-15 16:12 ` Shuah Khan
  1 sibling, 0 replies; 5+ messages in thread
From: Jeffrin Thalakkottoor @ 2020-12-15 13:05 UTC (permalink / raw)
  To: Shuah Khan; +Cc: open list:KERNEL SELFTEST FRAMEWORK, lkml

[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]

On Mon, Dec 14, 2020 at 10:12 PM Jeffrin Jose T
<jeffrin@rajagiritech.edu.in> wrote:
>
> 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
>
>


-- 
software engineer
rajagiri school of engineering and technology

[-- Attachment #2: diff-or.txt --]
[-- Type: text/plain, Size: 2317 bytes --]

diff --git a/tools/testing/selftests/intel_pstate/aperf.c b/tools/testing/selftests/intel_pstate/aperf.c
index f6cd03a87493..7e35e7872f16 100644
--- a/tools/testing/selftests/intel_pstate/aperf.c
+++ b/tools/testing/selftests/intel_pstate/aperf.c
@@ -6,7 +6,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
-#include <sys/timeb.h>
+#include <time.h>
 #include <sched.h>
 #include <errno.h>
 #include <string.h>
@@ -22,10 +22,12 @@ int main(int argc, char **argv) {
 	long long tsc, old_tsc, new_tsc;
 	long long aperf, old_aperf, new_aperf;
 	long long mperf, old_mperf, new_mperf;
-	struct timeb before, after;
+	struct timespec before, after;
+        clockid_t clkid;
 	long long int start, finish, total;
 	cpu_set_t cpuset;
 
+
 	if (argc != 2) {
 		usage(argv[0]);
 		return 1;
@@ -41,6 +43,10 @@ int main(int argc, char **argv) {
 
 	sprintf(msr_file_name, "/dev/cpu/%d/msr", cpu);
 	fd = open(msr_file_name, O_RDONLY);
+        #define CLOCKFD 3
+        #define FD_TO_CLOCKID(fd)   ((~(clockid_t) (fd) << 3) | CLOCKFD)
+        clkid = FD_TO_CLOCKID(fd);
+
 
 	if (fd == -1) {
 		printf("/dev/cpu/%d/msr: %s\n", cpu, strerror(errno));
@@ -55,7 +61,7 @@ int main(int argc, char **argv) {
 		return 1;
 	}
 
-	ftime(&before);
+	clock_gettime(clkid,&before);
 	pread(fd, &old_tsc,  sizeof(old_tsc), 0x10);
 	pread(fd, &old_aperf,  sizeof(old_mperf), 0xe7);
 	pread(fd, &old_mperf,  sizeof(old_aperf), 0xe8);
@@ -64,7 +70,7 @@ int main(int argc, char **argv) {
 		sqrt(i);
 	}
 
-	ftime(&after);
+	clock_gettime(clkid,&after);
 	pread(fd, &new_tsc,  sizeof(new_tsc), 0x10);
 	pread(fd, &new_aperf,  sizeof(new_mperf), 0xe7);
 	pread(fd, &new_mperf,  sizeof(new_aperf), 0xe8);
@@ -73,11 +79,10 @@ int main(int argc, char **argv) {
 	aperf = new_aperf-old_aperf;
 	mperf = new_mperf-old_mperf;
 
-	start = before.time*1000 + before.millitm;
-	finish = after.time*1000 + after.millitm;
-	total = finish - start;
-
-	printf("runTime: %4.2f\n", 1.0*total/1000);
-	printf("freq: %7.0f\n", tsc / (1.0*aperf / (1.0 * mperf)) / total);
+	start = before.tv_sec*1000000 + before.tv_nsec;
+	finish = after.tv_sec*1000000 + after.tv_nsec;
+	total = finish - start; 
+	printf("runTime: %4.2f\n", 1.0*total/1000000); 
+	printf("freq: %7.0f\n", tsc / (1.0 * aperf /1.0 * (mperf)) / total);
 	return 0;
 }

[-- Attachment #3: shot.txt --]
[-- Type: text/plain, Size: 1761 bytes --]

Setting maximum frequency to 500
launching aperf load on 0
launching aperf load on 1
launching aperf load on 2
launching aperf load on 3
sleeping for 5 seconds
waiting for job id 7521
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
waiting for job id 7522
waiting for job id 7523
waiting for job id 7524
Setting maximum frequency to 400
launching aperf load on 0
launching aperf load on 1
launching aperf load on 2
launching aperf load on 3
sleeping for 5 seconds
waiting for job id 7540
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
runTime: 0.00
freq:     inf
waiting for job id 7541
runTime: 0.00
freq:     inf
waiting for job id 7542
waiting for job id 7543
========================================================================
The marketing frequency of the cpu is 2300 MHz
The maximum frequency of the cpu is 2300 MHz
The minimum frequency of the cpu is 400 MHz
Target	      Actual	    Difference	  MSR(0x199)	max_perf_pct
2300	      2300	    0		  0x400		230000
2200	      2200	    0		  0x400		230000
2100	      2100	    0		  0x400		230000
2000	      2000	    0		  0x400		230000
1900	      1900	    0		  0x400		230000
1800	      1800	    0		  0x400		230000
1700	      1700	    0		  0x400		230000
1600	      1600	    0		  0x400		230000
1500	      1500	    0		  0x400		230000
1400	      1400	    0		  0x400		230000
1300	      1300	    0		  0x400		230000
1200	      1200	    0		  0x400		230000
1100	      1100	    0		  0x400		230000
1000	      999	    -1		  0x400		230000
900	      900	    0		  0x400		230000
800	      800	    0		  0x400		230000
700	      700	    0		  0x400		230000
600	      600	    0		  0x400		230000
500	      500	    0		  0x400		230000
400	      400	    0		  0

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: related to fixing depreciated api
  2020-12-14 16:42 related to fixing depreciated api Jeffrin Jose T
  2020-12-15 13:05 ` [WARNING ]Re: " Jeffrin Thalakkottoor
@ 2020-12-15 16:12 ` Shuah Khan
  2020-12-15 19:52   ` Shuah Khan
  1 sibling, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2020-12-15 16:12 UTC (permalink / raw)
  To: Jeffrin Jose T, Shuah Khan
  Cc: open list:KERNEL SELFTEST FRAMEWORK, lkml, Shuah Khan

On 12/14/20 9:42 AM, Jeffrin Jose T wrote:
> 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.
> 

Please send a proper patch to fix intel_pstate to use clock_gettime.

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: related to fixing depreciated api
  2020-12-15 16:12 ` Shuah Khan
@ 2020-12-15 19:52   ` Shuah Khan
  2020-12-15 23:02     ` Jeffrin Jose T
  0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2020-12-15 19:52 UTC (permalink / raw)
  To: Jeffrin Jose T, Shuah Khan
  Cc: open list:KERNEL SELFTEST FRAMEWORK, lkml, Shuah Khan

On 12/15/20 9:12 AM, Shuah Khan wrote:
> On 12/14/20 9:42 AM, Jeffrin Jose T wrote:
>> 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.
>>
> 
> Please send a proper patch to fix intel_pstate to use clock_gettime.
> 

The fix for this is already in next - no need to send patch.

thanks,
-- Shuah


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: related to fixing depreciated api
  2020-12-15 19:52   ` Shuah Khan
@ 2020-12-15 23:02     ` Jeffrin Jose T
  0 siblings, 0 replies; 5+ messages in thread
From: Jeffrin Jose T @ 2020-12-15 23:02 UTC (permalink / raw)
  To: Shuah Khan, Shuah Khan; +Cc: open list:KERNEL SELFTEST FRAMEWORK, lkml

On Tue, 2020-12-15 at 12:52 -0700, Shuah Khan wrote:
> On 12/15/20 9:12 AM, Shuah Khan wrote:
> > On 12/14/20 9:42 AM, Jeffrin Jose T wrote:
> > > 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.
> > > 
> > 
> > Please send a proper patch to fix intel_pstate to use
> > clock_gettime.
> > 
> 
> The fix for this is already in next - no need to send patch.
> 
> thanks,
> -- Shuah
> 
anyway thanks .


-- 
software engineer
rajagiri school of engineering and technology - autonomous



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2020-12-15 23:04 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-14 16:42 related to fixing depreciated api Jeffrin Jose T
2020-12-15 13:05 ` [WARNING ]Re: " Jeffrin Thalakkottoor
2020-12-15 16:12 ` Shuah Khan
2020-12-15 19:52   ` Shuah Khan
2020-12-15 23:02     ` Jeffrin Jose T

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).