• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

hardware/intel/libva


Commit MetaInfo

Revisão81db15a2ef6235d3154b112698d2504ba8db0cfc (tree)
Hora2016-05-23 08:35:23
AutorScott D Phillips <scott.d.phillips@inte...>
CommiterSean V Kelley

Mensagem de Log

trace: Add va_TracePrint, va_TraceVPrint static functions

These functions are similar to va_TraceMsg() but without emitting
a timestamp.

Signed-off-by: Scott D Phillips <scott.d.phillips@intel.com>
Reviewed-by: Sean V Kelley <seanvk@posteo.de>

Mudança Sumário

Diff

--- a/va/va_trace.c
+++ b/va/va_trace.c
@@ -877,10 +877,9 @@ void va_TraceEnd(VADisplay dpy)
877877 ((VADisplayContextP)dpy)->vatrace = NULL;
878878 }
879879
880-static void va_TraceMsg(struct trace_context *trace_ctx, const char *msg, ...)
880+static void va_TraceVPrint(struct trace_context *trace_ctx, const char *msg, va_list args)
881881 {
882882 FILE *fp = NULL;
883- va_list args;
884883
885884 if (!(trace_flag & VA_TRACE_FLAG_LOG)
886885 || !trace_ctx->plog_file)
@@ -888,25 +887,44 @@ static void va_TraceMsg(struct trace_context *trace_ctx, const char *msg, ...)
888887
889888 fp = trace_ctx->plog_file->fp_log;
890889 if (msg) {
891- struct timeval tv;
892-
893- if (gettimeofday(&tv, NULL) == 0)
894- fprintf(fp, "[%04d.%06d]",
895- (unsigned int)tv.tv_sec & 0xffff, (unsigned int)tv.tv_usec);
896-
897- if(trace_ctx->trace_context != VA_INVALID_ID)
898- fprintf(fp,
899- "[ctx 0x%08x]", trace_ctx->trace_context);
900- else
901- fprintf(fp, "[ctx none]");
902-
903- va_start(args, msg);
904890 vfprintf(fp, msg, args);
905- va_end(args);
906891 } else
907892 fflush(fp);
908893 }
909894
895+static void va_TracePrint(struct trace_context *trace_ctx, const char *msg, ...)
896+{
897+ va_list args;
898+ va_start(args, msg);
899+ va_TraceVPrint(trace_ctx, msg, args);
900+ va_end(args);
901+}
902+
903+static void va_TraceMsg(struct trace_context *trace_ctx, const char *msg, ...)
904+{
905+ va_list args;
906+ struct timeval tv;
907+
908+ if (!msg) {
909+ va_TracePrint(trace_ctx, msg);
910+ return;
911+ }
912+
913+ if (gettimeofday(&tv, NULL) == 0)
914+ va_TracePrint(trace_ctx, "[%04d.%06d]",
915+ (unsigned int)tv.tv_sec & 0xffff, (unsigned int)tv.tv_usec);
916+
917+ if(trace_ctx->trace_context != VA_INVALID_ID)
918+ va_TracePrint(trace_ctx,
919+ "[ctx 0x%08x]", trace_ctx->trace_context);
920+ else
921+ va_TracePrint(trace_ctx, "[ctx none]");
922+
923+ va_start(args, msg);
924+ va_TraceVPrint(trace_ctx, msg, args);
925+ va_end(args);
926+}
927+
910928 static void va_TraceSurface(VADisplay dpy, VAContextID context)
911929 {
912930 unsigned int i, j;