From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id CA1804C48E for ; Fri, 7 Feb 2025 06:27:51 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id D286068BD02; Fri, 7 Feb 2025 08:27:42 +0200 (EET) Received: from mail-pl1-f178.google.com (mail-pl1-f178.google.com [209.85.214.178]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id A5C70689DB3 for ; Fri, 7 Feb 2025 08:27:31 +0200 (EET) Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-21f5660c2fdso3007735ad.2; Thu, 06 Feb 2025 22:27:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1738909650; x=1739514450; darn=ffmpeg.org; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=PftiYabh+RIImAQ8GVaEs5P3bQI6wADOMuZa4Apdg/w=; b=acj/ZGyZXhgth7CC19WI8PBGbbihCqUc90pzMMXmBXN2Eh9rjixx5ksWB8tonRZ760 1ZKoFLdwK4zP5O5ym+m9Xo8J20S2wvwwFzh1/HWKWyJlHEvIj9OhzQ/m3/ocqsHlQrxb 5AudXEmKycGcWVrgItntGjpVpnceql+2ldRPAqREdUVP0CC1va+/1RBtUYsUebAM7Wb5 9DwT/0ZjykYCiBh9TT5ZkClCzoYL3sgqyMZP5ZWWDoHuYdAARlQQqJq2xCrrdzjTG3ez l14uSm0723WbHw2tzNjL88mtzZ1IUAuJIVCC4gNLDZXoLHuzbIu4OUNFiBq/iuK/SpdL MLyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738909650; x=1739514450; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=PftiYabh+RIImAQ8GVaEs5P3bQI6wADOMuZa4Apdg/w=; b=SkPHsZInExGrYhx5Q2aQDQyo0Za82eJZLmV1IfZ3WoUw2vIVgxQM+5J+/dTLYQ+2X9 5zz3IvqrA2cQBNGlmTe0f31PmtCV9mUMjTyKD+QoSnWP2qGdvAyNM8lPSEUuFHWQlZ8b Asz0emL4AD7+46hhLQVV3F+WRhy/qJINQQ9idnI1lKoFFCFpHL32q6PEa3QVltopkWmb GBP6fXsh2l3TK/B3a3cSEOm354hOX4PjLrUh/p3rPQCqQ/oit2F3gAt0JfC/MTApF8CD p8kEAey/0mdzO9zZLEZZAaDKYcmGc5M2p7hBQXno35ah+m0I7bwslMrVVDSMxnTrU6y/ zPAg== X-Forwarded-Encrypted: i=1; AJvYcCUBrn9nynrOW/oVE/f7ONe5iDx2Ne1uvipSPXyPafPF7mc3Y0CPZqKkLZWDxfOWS9h0NXsjbDioj6LE9Gsw3aDYlhZzRxeG8B4=@ffmpeg.org X-Gm-Message-State: AOJu0YwyczQtbo3AWjfOgyC/Vyo0Gj3WUIfQPTtC4NojILWybIXu3miL C/pTHXPSD65ETt76hxd1JZwc2XEcFpInGUHkXf7rW5aZ6MsrtihlxR/asw== X-Gm-Gg: ASbGncuwOCN58uq9XoqwYok+MSmWxylhnjXSfCqDcNRU4BGyG4bwlcfyItR6ByCUszq BTHy9ppJg+Qhl4DzRCA96mz4yOpk7nsUYuGKW8xEQjV4BUQFrb6TcBaVh1iz8U0zRymlibFkHO4 sRfTSe1HGBz+ER3qGqU6KQkPQWwaEkPLMPEPAH8CQhBKi78XNQ90MDPCyNRIFeQYqX8AN41X1TE R026CDFeh1QsKiv3lBzKKfbCBjtVsVhepOmKheu0p5tFN1BqvNbd6YyBTLQL4VMPdUQvsMQcMo5 zFocVG6EE1g2BNtaWdiqxSVeGO0S6QHN+A== X-Google-Smtp-Source: AGHT+IHIxfof5b+8s8IOY9m22yQmN7GzORD4WhHR7FL5bcWN4xtauDc4CSTN92EulCWMUbnI6AuU9Q== X-Received: by 2002:a17:902:ce90:b0:216:2426:7666 with SMTP id d9443c01a7336-21f4e6b8854mr39407055ad.12.1738909649636; Thu, 06 Feb 2025 22:27:29 -0800 (PST) Received: from [127.0.0.1] (master.gitmailbox.com. [34.83.118.50]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21f3687c17csm23114595ad.183.2025.02.06.22.27.29 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Feb 2025 22:27:29 -0800 (PST) Message-Id: In-Reply-To: References: From: ffmpegagent Date: Fri, 07 Feb 2025 06:27:23 +0000 Fcc: Sent MIME-Version: 1.0 To: ffmpeg-devel@ffmpeg.org Subject: [FFmpeg-devel] [PATCH v4 0/3] Add option to log timing X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Michael Niedermayer , softworkz , Soft Works , Marth64 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: This pathcset adds two logging flags: 'timing' and 'datetiming'. Usage: ffmpeg -loglevel +timing or ffmpeg -loglevel +datetiming Update V1 * Fix merge conflicts Update V2 * Rebased Update V3 * Fix print timing on exit (as reported by Michael Niedermayer) softworkz (3): avutil/log: support logging of date and timing information fftools/opt_common: add timing and datetiming log flags doc/fftools-common-opts: document log timing flags doc/APIchanges | 3 +++ doc/fftools-common-opts.texi | 4 ++++ fftools/ffmpeg.c | 1 + fftools/opt_common.c | 12 ++++++++++++ libavutil/log.c | 32 +++++++++++++++++++++++++++++--- libavutil/log.h | 10 ++++++++++ libavutil/version.h | 2 +- 7 files changed, 60 insertions(+), 4 deletions(-) base-commit: 4ba9ae7742a6f8a29d6486e25ff5709a075edb5b Published-As: https://github.com/ffstaging/FFmpeg/releases/tag/pr-ffstaging-37%2Fsoftworkz%2Fsubmit_logtiming-v4 Fetch-It-Via: git fetch https://github.com/ffstaging/FFmpeg pr-ffstaging-37/softworkz/submit_logtiming-v4 Pull-Request: https://github.com/ffstaging/FFmpeg/pull/37 Range-diff vs v3: 1: 13a7dc164b ! 1: 2871595d3b avutil/log: support logging of date and timing information @@ libavutil/log.c: static const char *item_name(void *obj, const AVClass *cls) return (cls->item_name ? cls->item_name : av_default_item_name)(obj); } -+static void format_date_now(AVBPrint* timeBuf, int include_date) ++static void format_date_now(AVBPrint* bp_time, int include_date) +{ + struct tm *ptm, tmbuf; + const int64_t time_us = av_gettime(); @@ libavutil/log.c: static const char *item_name(void *obj, const AVClass *cls) + ptm = localtime_r(&time_s, &tmbuf); + if (ptm) { + if (include_date) -+ av_bprint_strftime(timeBuf, "%Y-%m-%d ", ptm); ++ av_bprint_strftime(bp_time, "%Y-%m-%d ", ptm); + -+ av_bprint_strftime(timeBuf, "%H:%M:%S", ptm); -+ av_bprintf(timeBuf, ".%03d ", millisec); ++ av_bprint_strftime(bp_time, "%H:%M:%S", ptm); ++ av_bprintf(bp_time, ".%03d ", millisec); + } +} + 2: 6c435fc02d ! 2: aed251e1f5 fftools/opt_common: add timing and datetiming log flags @@ fftools/opt_common.c: int opt_loglevel(void *optctx, const char *opt, const char } else { flags |= AV_LOG_PRINT_LEVEL; } -+ } else if (av_strstart(token, "timing", &arg)) { ++ } else if (av_strstart(token, "time", &arg)) { + if (cmd == '-') { + flags &= ~AV_LOG_PRINT_TIME; + } else { + flags |= AV_LOG_PRINT_TIME; + } -+ } else if (av_strstart(token, "datetiming", &arg)) { ++ } else if (av_strstart(token, "datetime", &arg)) { + if (cmd == '-') { + flags &= ~AV_LOG_PRINT_DATETIME; + } else { 3: f0aa91d5c1 ! 3: 600020f36e doc/fftools-common-opts: document log timing flags @@ doc/fftools-common-opts.texi: and the "Last message repeated n times" line will Indicates that log output should add a @code{[level]} prefix to each message line. This can be used as an alternative to log coloring, e.g. when dumping the log to file. -+@item timing -+Indicates that log lines should be prefixed with timing information. -+@item datetiming -+Indicates that log lines should be prefixed with date and timing information. ++@item time ++Indicates that log lines should be prefixed with time information. ++@item datetime ++Indicates that log lines should be prefixed with date and time information. @end table Flags can also be used alone by adding a '+'/'-' prefix to set/reset a single flag without affecting other @var{flags} or changing @var{loglevel}. When -- ffmpeg-codebot _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".