From 10b3f049e5bc42e428602c0de3d87ee3e51a071f Mon Sep 17 00:00:00 2001 From: William Cohen Date: Fri, 19 Oct 2018 14:59:27 -0400 Subject: [PATCH] Use cast to make c->cycles_sum aways match the %lld format. On aarch64 and ppc64le cycles_t is a slightly different type from the x86_64 and does not match up with the %lld format. Cast c->cyles_sum to always be (long long) to avoid the compile failing on aarch64 and ppc64le with the following message: **** failed systemtap kernel-devel smoke test: /tmp/stapzubPmR/stap_e418199b88a6f8adf13a14e064ae79da_1403_src.c: In function '_stp_hrtimer_notify_function': /tmp/stapzubPmR/stap_e418199b88a6f8adf13a14e064ae79da_1403_src.c:477:45: error: format '%lld' expects argument of type 'long long int', but argument 2 has type 'cycles_t' {aka 'long unsigned int'} [-Werror=format=] _stp_error ("probe overhead (%lld cycles) exceeded threshold (%lld cycles) in last %lld cycles", c->cycles_sum, STP_OVERLOAD_THRESHOLD, STP_OVERLOAD_INTERVAL); ~~~^ ~~~~~~~~~~~~~ %ld cc1: all warnings being treated as errors --- tapsets.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tapsets.cxx b/tapsets.cxx index a28546868..25bb35d19 100644 --- a/tapsets.cxx +++ b/tapsets.cxx @@ -302,7 +302,7 @@ common_probe_entryfn_epilogue (systemtap_session& s, s.op->newline() << "if (interval > STP_OVERLOAD_INTERVAL) {"; s.op->newline(1) << "if (c->cycles_sum > STP_OVERLOAD_THRESHOLD) {"; s.op->newline(1) << "_stp_error (\"probe overhead (%lld cycles) exceeded threshold (%lld cycles) in last" - " %lld cycles\", c->cycles_sum, STP_OVERLOAD_THRESHOLD, STP_OVERLOAD_INTERVAL);"; + " %lld cycles\", (long long) c->cycles_sum, STP_OVERLOAD_THRESHOLD, STP_OVERLOAD_INTERVAL);"; s.op->newline() << "atomic_set (session_state(), STAP_SESSION_ERROR);"; s.op->newline() << "atomic_inc (error_count());"; s.op->newline(-1) << "}"; -- 2.43.5