1 // SPDX-License-Identifier: GPL-2.0-or-later 2 /* 3 * Copyright (c) 2017 Cyril Hrubis <chrubis@suse.cz> 4 */ 5 6 /* 7 8 Timer measuring library. 9 10 The test is supposed to define sampling function and set it in the tst_test 11 structure the rest of the work is then done by the library. 12 13 int sample(int clk_id, long long usec) 14 { 15 // Any setup done here 16 17 tst_timer_start(clk_id); 18 // Call that is being measured sleeps for usec 19 tst_timer_stop(); 20 tst_timer_sample(); 21 22 // Any cleanup done here 23 24 // Non-zero return exits the test 25 } 26 27 struct tst_test test = { 28 .scall = "syscall_name()", 29 .sample = sample, 30 }; 31 32 */ 33 34 #ifndef TST_TIMER_TEST__ 35 #define TST_TIMER_TEST__ 36 37 #include "tst_test.h" 38 #include "tst_timer.h" 39 40 void tst_timer_sample(void); 41 42 # ifdef TST_NO_DEFAULT_MAIN 43 struct tst_test *tst_timer_test_setup(struct tst_test *test); 44 # endif /* TST_NO_DEFAULT_MAIN */ 45 #endif /* TST_TIMER_TEST__ */ 46