From patchwork Mon Aug 3 09:14:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 51856 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by patches.linaro.org (Postfix) with ESMTPS id 77561229FD for ; Mon, 3 Aug 2015 09:22:09 +0000 (UTC) Received: by labby2 with SMTP id by2sf25224843lab.3 for ; Mon, 03 Aug 2015 02:22:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding:cc :subject:precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:errors-to:sender:x-original-sender :x-original-authentication-results:mailing-list; bh=w0jSUrUnF0+W93GMCFPBUQIEJD+iuV5rQvoCGdytRlI=; b=dLmnCH7pGgWK7SCGjl4Sb818/YiMHMp8O5e8lAseRBYL81hP5r5IaEo0JNujvPcFRU P3yv8HGL5H+JOGtrpJn0ysTZ3O/rTZvFnzAAcjvE/RNibG9vQRIbGctb9B9kH3hdnZPt 4WVXG4lR6WIT/ly2eG4oEGyP4BBqvehnzDry8gaIhyxrU+snbAZoGs+ql2AZ64TMDNPu 3ZZYDtzfsx7Gp1zIpUG0xsdXCmsI4qEquMOCLnwmE5dg9epY+e7HYwD6w1sBLh8Ij5bF hZMkMeADpA4wnSxbXjjGBwEgSf+DrevTN9wjWrmbQFKkvU/rFTZg7k1KmOJAmYQ4Ym+C sYFA== X-Gm-Message-State: ALoCoQlidpstG75CThJVqPPpxMUPVwjLyBIMI0rC0PPYDLEW3B+AG3Pf2B40hWFBfKrn1jfVPOZX X-Received: by 10.194.179.42 with SMTP id dd10mr5293589wjc.7.1438593728420; Mon, 03 Aug 2015 02:22:08 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.204.9 with SMTP id ku9ls549932lac.37.gmail; Mon, 03 Aug 2015 02:22:08 -0700 (PDT) X-Received: by 10.112.63.169 with SMTP id h9mr15903391lbs.104.1438593728247; Mon, 03 Aug 2015 02:22:08 -0700 (PDT) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com. [209.85.215.54]) by mx.google.com with ESMTPS id hh8si7724946lbb.126.2015.08.03.02.22.08 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 02:22:08 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) client-ip=209.85.215.54; Received: by labpt2 with SMTP id pt2so11499066lab.0 for ; Mon, 03 Aug 2015 02:22:08 -0700 (PDT) X-Received: by 10.112.126.101 with SMTP id mx5mr16064182lbb.35.1438593727973; Mon, 03 Aug 2015 02:22:07 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp1756411lba; Mon, 3 Aug 2015 02:22:06 -0700 (PDT) X-Received: by 10.107.17.170 with SMTP id 42mr19464005ior.21.1438593726406; Mon, 03 Aug 2015 02:22:06 -0700 (PDT) Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id kq6si5392377igb.82.2015.08.03.02.22.05 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 03 Aug 2015 02:22:06 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Received: from localhost ([::1]:58237 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMBwb-0000Al-8j for patch@linaro.org; Mon, 03 Aug 2015 05:22:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41327) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMBpv-0005RO-Sn for qemu-devel@nongnu.org; Mon, 03 Aug 2015 05:15:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZMBps-0003MX-TW for qemu-devel@nongnu.org; Mon, 03 Aug 2015 05:15:11 -0400 Received: from mail-wi0-f175.google.com ([209.85.212.175]:38645) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZMBps-0003Le-Fs for qemu-devel@nongnu.org; Mon, 03 Aug 2015 05:15:08 -0400 Received: by wibxm9 with SMTP id xm9so105252159wib.1 for ; Mon, 03 Aug 2015 02:15:08 -0700 (PDT) X-Received: by 10.194.158.34 with SMTP id wr2mr31808391wjb.23.1438593308063; Mon, 03 Aug 2015 02:15:08 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id fq15sm21866093wjc.12.2015.08.03.02.15.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 03 Aug 2015 02:15:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E9F313E08D6; Mon, 3 Aug 2015 10:15:00 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Mon, 3 Aug 2015 10:14:50 +0100 Message-Id: <1438593291-27109-11-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1438593291-27109-1-git-send-email-alex.bennee@linaro.org> References: <1438593291-27109-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.85.212.175 Cc: qemu-trivial@nongnu.org, crosthwaitepeter@gmail.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH v4 10/11] vl.c: log system invocation when enabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: alex.bennee@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.54 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 This makes it a little easier to remember how you generated that 100Mb trace log you saved for a future date. Signed-off-by: Alex Bennée --- configure | 2 +- vl.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 704b34c..9cc6a48 100755 --- a/configure +++ b/configure @@ -1445,7 +1445,7 @@ else fi gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits" -gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags" +gcc_flags="-Wformat-security -Wno-format-y2k -Winit-self -Wignored-qualifiers $gcc_flags" gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags" gcc_flags="-Wendif-labels $gcc_flags" gcc_flags="-Wno-initializer-overrides $gcc_flags" diff --git a/vl.c b/vl.c index 05211cf..6f0ae74 100644 --- a/vl.c +++ b/vl.c @@ -4094,12 +4094,30 @@ int main(int argc, char **argv, char **envp) if (log_mask) { int mask; + char fmt_time[512]; + time_t start_time = time(NULL); + struct tm *local_start = localtime(&start_time); + + + if (log_file) { + qemu_set_log_filename(log_file); + } + mask = qemu_str_to_log_mask(log_mask); if (!mask) { qemu_print_log_usage(stdout); exit(1); } qemu_set_log(mask); + + if (strftime(fmt_time, sizeof(fmt_time), "%c", local_start) > 0) { + qemu_log("System Emulation started at %s\n", fmt_time); + qemu_log("Invocation:"); + for (i = 0; i < argc; i++) { + qemu_log("%s ", argv[i]); + } + qemu_log("\n"); + } } if (!is_daemonized()) {