log.h 595 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __SELFTEST_TIMENS_LOG_H__
  3. #define __SELFTEST_TIMENS_LOG_H__
  4. #define pr_msg(fmt, lvl, ...) \
  5. ksft_print_msg("[%s] (%s:%d)\t" fmt "\n", \
  6. lvl, __FILE__, __LINE__, ##__VA_ARGS__)
  7. #define pr_p(func, fmt, ...) func(fmt ": %m", ##__VA_ARGS__)
  8. #define pr_err(fmt, ...) \
  9. ({ \
  10. ksft_test_result_error(fmt "\n", ##__VA_ARGS__); \
  11. -1; \
  12. })
  13. #define pr_fail(fmt, ...) \
  14. ({ \
  15. ksft_test_result_fail(fmt, ##__VA_ARGS__); \
  16. -1; \
  17. })
  18. #define pr_perror(fmt, ...) pr_p(pr_err, fmt, ##__VA_ARGS__)
  19. #endif