X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fafb-hook.c;h=6afcd2fb68c53616913631ba73b46e1281a3dc47;hb=524ce4c40da3b25630dffdd80c5aca99364a3569;hp=cade990cc1346271b063c74ee6d00887c5784a53;hpb=06c7e1c7e9aec77a1a22ccb14dd0e540cf08f5d9;p=src%2Fapp-framework-binder.git diff --git a/src/afb-hook.c b/src/afb-hook.c index cade990c..6afcd2fb 100644 --- a/src/afb-hook.c +++ b/src/afb-hook.c @@ -210,6 +210,24 @@ static void hook_xreq_subcallsync_result_default_cb(void * closure, const struct _hook_xreq_(xreq, " ...subcallsync... -> %d: %s", status, json_object_to_json_string(result)); } +static void hook_xreq_vverbose_default_cb(void * closure, const struct afb_xreq *xreq, int level, const char *file, int line, const char *func, const char *fmt, va_list args) +{ + int len; + char *msg; + va_list ap; + + va_copy(ap, args); + len = vasprintf(&msg, fmt, ap); + va_end(ap); + + if (len < 0) + _hook_xreq_(xreq, "vverbose(%d, %s, %d, %s) -> %s ? ? ?", level, file, line, func, fmt); + else { + _hook_xreq_(xreq, "vverbose(%d, %s, %d, %s) -> %s", level, file, line, func, msg); + free(msg); + } +} + static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_begin = hook_xreq_begin_default_cb, .hook_xreq_end = hook_xreq_end_default_cb, @@ -229,6 +247,7 @@ static struct afb_hook_xreq_itf hook_xreq_default_itf = { .hook_xreq_subcall_result = hook_xreq_subcall_result_default_cb, .hook_xreq_subcallsync = hook_xreq_subcallsync_default_cb, .hook_xreq_subcallsync_result = hook_xreq_subcallsync_result_default_cb, + .hook_xreq_vverbose = hook_xreq_vverbose_default_cb }; /****************************************************************************** @@ -349,6 +368,11 @@ int afb_hook_xreq_subcallsync_result(const struct afb_xreq *xreq, int status, st return status; } +void afb_hook_xreq_vverbose(const struct afb_xreq *xreq, int level, const char *file, int line, const char *func, const char *fmt, va_list args) +{ + _HOOK_XREQ_(vverbose, xreq, level, file ?: "?", line, func ?: "?", fmt, args); +} + /****************************************************************************** * section: hooking xreqs *****************************************************************************/