From 51c749a976fbf041f5624a22457db57c6f80e4f1 Mon Sep 17 00:00:00 2001 From: Nadav Har'El <nyh@cloudius-systems.com> Date: Sun, 13 Oct 2013 23:15:14 +0300 Subject: [PATCH] Allow using floats and double values in tracepoints The new scheduling algorithm is based on floating point runtimes, and I'd like to be able to tracepoints to debug it. Adding floats and doubles is trivial - we just need to tell the C++ tracing code to use the character "f" for floats and "d" for doubles, and Python (run in gdb when we use "osv trace") already knows how to unpack values with these designations. Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com> --- include/osv/trace.hh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/osv/trace.hh b/include/osv/trace.hh index a0d5233b6..f2bb7918a 100644 --- a/include/osv/trace.hh +++ b/include/osv/trace.hh @@ -144,6 +144,16 @@ struct signature_char<bool> { static const char sig = '?'; }; +template <> +struct signature_char<float> { + static const char sig = 'f'; +}; + +template <> +struct signature_char<double> { + static const char sig = 'd'; +}; + template <typename T> struct signature_char<T*> { static const char sig = 'P'; -- GitLab