Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp66687imm; Wed, 5 Sep 2018 15:06:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbP9xc/Vyht+lbAL5jLZGXF+RKJHiPr+2363VO5S2kHfiUbQPtRUNK334BhTqUfBPExZFqN X-Received: by 2002:a17:902:d688:: with SMTP id v8-v6mr40835185ply.278.1536185190964; Wed, 05 Sep 2018 15:06:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536185190; cv=none; d=google.com; s=arc-20160816; b=A6Y0KD1iccRXUwGiVS1sBmhsAtE40Y6elVF26X6dBW2Rr40/Yg9IFuoE5JWjFr7zCU 3pRq+g2HRFFxvN0Rwxby92L9VcmONGBVbs7KcHPlohPw+Mm6G3KbEhjhds/zb9YyxXbk ibRgYeFf0oSRLHAB0zH5QYn5NoO7jAR7Go4GQ/i7hS/IUrLh8OrfNPObfBL7+Mi2Gvp3 Lf6R6IH0KkM12yHun9ZIpzbY9w/Bg+YEMlkBvg7FhFwiGnMljXsCp3z0VtLwVCfR+cZR esK2MN12ezH/yrFizXxLMsr4aCkbgeOv+2Xet+uH3GXFpbw0Z0Bl9ZfCb50InNls2H3/ 9lKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=0+0xhO6WsicSrlfdNtXJI3iVT6c4oHFE+0pDnXC7HeU=; b=bu8zFcMJpsxlkb+FXRTSE/LjWHpDUNxHpBsLqZ3+1xRk14/CdkvTpvFIwVyvgbJdn7 ZvuHz+1dn3GWjLp78XvIRU21wQCy6ZpohTaliihUQTPmYukj3oKq7JEHuIs6gXY4scFh lpY/qfTo7Iw6lyFVcPFuwi5bXS3I5Jiu2awnJf11Ms3scP6Fq8cpVgeWMIwFElmlX3iq OdbUwia/AOK3wGUg2yAD2BQBZ3Y5qtSaOJXadFX1h4SvUknIPbUh+Ktn/y1/MkIwCVKx QB6YE9V+aSVUflhQ2x/9Je9lH6G7xQTpi5r4kebJ7Gb2Sb2Xx7HQR0hC5kHNRWCfKDfl lS+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KZfPJrRT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17-v6si3272692pfi.183.2018.09.05.15.06.15; Wed, 05 Sep 2018 15:06:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KZfPJrRT; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbeIFChP (ORCPT + 99 others); Wed, 5 Sep 2018 22:37:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:51218 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727518AbeIFChP (ORCPT ); Wed, 5 Sep 2018 22:37:15 -0400 Received: from jouet.infradead.org (unknown [179.97.41.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A51BB2077C; Wed, 5 Sep 2018 22:05:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1536185103; bh=8gbwI/bMLMwtGsCTJbnIcwxH8ENwTnUi38GFkqyTEsQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KZfPJrRTUprngxVX4U3VeiByP09mw1DKi9IUJ1InU+oXlNat1c4rxzVTbzi6RxbJS LQEI82b/4CBwvSUo3wlSGwblWOR8jvXuCSOQuSvPP+zKuOVnS9po1vDL62SF/PSA3S H3LA2ZrttxCZIk8fp2WosX+FlP1RFLW38azmZbbg= From: Arnaldo Carvalho de Melo To: Ingo Molnar Cc: Clark Williams , linux-kernel@vger.kernel.org, linux-perf-users@vger.kernel.org, Arnaldo Carvalho de Melo , Adrian Hunter , David Ahern , Jiri Olsa , Namhyung Kim , Wang Nan Subject: [PATCH 04/77] perf trace: Extract the comm/tid printing for syscall enter Date: Wed, 5 Sep 2018 19:03:27 -0300 Message-Id: <20180905220440.20256-5-acme@kernel.org> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180905220440.20256-1-acme@kernel.org> References: <20180905220440.20256-1-acme@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Arnaldo Carvalho de Melo Will be used with augmented syscalls, where we haven't transitioned completely to combining sys_enter_FOO with sys_exit_FOO, so we'll go as far as having it similar to the end result, strace like, as possible. Cc: Adrian Hunter Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Wang Nan Link: https://lkml.kernel.org/n/tip-canomaoiybkswwnhj69u9ae4@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-trace.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index bcf882afd6d0..92488edd00eb 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c @@ -1144,11 +1144,9 @@ static void sig_handler(int sig) interrupted = sig == SIGINT; } -static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, - u64 duration, bool duration_calculated, u64 tstamp, FILE *fp) +static size_t trace__fprintf_comm_tid(struct trace *trace, struct thread *thread, FILE *fp) { - size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); - printed += fprintf_duration(duration, duration_calculated, fp); + size_t printed = 0; if (trace->multiple_threads) { if (trace->show_comm) @@ -1159,6 +1157,14 @@ static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thre return printed; } +static size_t trace__fprintf_entry_head(struct trace *trace, struct thread *thread, + u64 duration, bool duration_calculated, u64 tstamp, FILE *fp) +{ + size_t printed = trace__fprintf_tstamp(trace, tstamp, fp); + printed += fprintf_duration(duration, duration_calculated, fp); + return printed + trace__fprintf_comm_tid(trace, thread, fp); +} + static int trace__process_event(struct trace *trace, struct machine *machine, union perf_event *event, struct perf_sample *sample) { -- 2.14.4