2020-12-14 18:12:39

by Jeffrin Thalakkottoor

[permalink] [raw]
Subject: related to fixing depreciated api

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



Attachments:
diff-or.txt (2.26 kB)
shot.txt (1.72 kB)
Download all attachments

2020-12-15 13:10:38

by Jeffrin Thalakkottoor

[permalink] [raw]
Subject: [WARNING ]Re: related to fixing depreciated api

On Mon, Dec 14, 2020 at 10:12 PM Jeffrin Jose T
<[email protected]> 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


Attachments:
diff-or.txt (2.26 kB)
shot.txt (1.72 kB)
Download all attachments

2020-12-15 16:15:34

by Shuah Khan

[permalink] [raw]
Subject: Re: related to fixing depreciated api

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

2020-12-15 19:55:51

by Shuah Khan

[permalink] [raw]
Subject: Re: related to fixing depreciated api

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

2020-12-15 23:08:04

by Jeffrin Thalakkottoor

[permalink] [raw]
Subject: Re: related to fixing depreciated api

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