Hi!
> In the original test, if no error upon perfcounter, this test will
> never end. Add a "loop" variable to force stopping when no issues detected
> 
> Signed-off-by: Xu,Anhua <[email protected]>
> ---
>  .../performance_counters/performance_counter01.c   |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/testcases/kernel/performance_counters/performance_counter01.c 
> b/testcases/kernel/performance_counters/performance_counter01.c
> index 23cc31b..7ffd15a 100644
> --- a/testcases/kernel/performance_counters/performance_counter01.c
> +++ b/testcases/kernel/performance_counters/performance_counter01.c
> @@ -67,7 +67,7 @@ void cleanup(void) { /* Stub function. */ }
>  int
>  main(void) {
>  
> -     unsigned long long count1, count2;
> +     unsigned long long count1, count2, loop = 100;
>       int fd1, fd2, ret;
>  
>       fd1 = syscall(__NR_perf_event_open,
> @@ -103,7 +103,7 @@ main(void) {
>  
>               }
>  
> -     } while (ret == sizeof(unsigned long long));
> +     } while (ret == sizeof(unsigned long long) && loop--);
>  
>       tst_exit();

Hmm, and also the return value from read should be checked and
the test should fail if read() has returned error.

-- 
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual 
desktops for less than the cost of PCs and save 60% on VDI infrastructure 
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to