Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp296939pxf; Wed, 31 Mar 2021 03:40:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzI4TkKhbH+YmveJvCP1FajJ7LneWbz7lywUTy1nbnAPTM/43wiJ7HVLx/8oDTwOwcE+qBN X-Received: by 2002:a17:906:6703:: with SMTP id a3mr2770866ejp.240.1617187208229; Wed, 31 Mar 2021 03:40:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617187208; cv=none; d=google.com; s=arc-20160816; b=Np8U4C4Ih5r52pcfIxpdIvLC5rzQ5LnqzLRAj3plC3GsDFrLD8TGoS2ykJvFpf5g+F jNNY4Zfvsxfrm5L6llVwD6qa2RrLB1pEr7NDKFVKNJ2zvCwoPgOhbTKHgcudIHrLOp5+ BegBbgzww0aYe7s3sszEB3/FZt2RWSq0BzTgdahBu0QJbAIJT1EyJgog8emE3gtJZICO ipgW6SDPkGJGq8gDLSdSGTstcJMzDlptGap6eAHKSwfI7Z9d8xmaGgPBct7+KghJ2Lwe eKWaVzN0k0nFnz13bwoH3CwFBpDopaZwQYfTDjj7GyCJbRh6jKWcYl/uV0jc2UIYrbye xfrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=PZ2H+bB94yyCMNnkVrq8RWg2Hq/HMuHFjJ6M40WD60c=; b=XExbJ3bfAwfVWX6M130LZOl9tCGh5zP8G7T16T5Awt0Dbcj6smaSns4RvcYpLwlaOF Qrx0Dcqyy39+GcYrVekRKjiONfQa3MSQwydGyxjJnNisPW4J9vOtGqMqoWZlEx06DbUL zWQK8Q/aFFsykMBSUk2mxPrU+akOkaa+H0++Q9Eah3OrEcuWRp3hjwc02jRgU95Mumy0 OGpn4GAXis9/zGSFUFhAxcRnFuZ4yUzFltcAy73rfzYzy4JxICOkJWrrwkXIzeJvS97i axnyf9G3yaDvOqKXChYoXzTYqf1wuhw/8BtYR3vDVu5xB7otSJ3pAyMHzc8YjoD+ld97 iy+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=C8u7NjYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ho20si1434362ejc.295.2021.03.31.03.39.44; Wed, 31 Mar 2021 03:40:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@codeweavers.com header.s=6377696661 header.b=C8u7NjYv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=codeweavers.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234862AbhCaKit (ORCPT + 99 others); Wed, 31 Mar 2021 06:38:49 -0400 Received: from mail.codeweavers.com ([50.203.203.244]:48280 "EHLO mail.codeweavers.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234875AbhCaKiW (ORCPT ); Wed, 31 Mar 2021 06:38:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codeweavers.com; s=6377696661; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=PZ2H+bB94yyCMNnkVrq8RWg2Hq/HMuHFjJ6M40WD60c=; b=C8u7NjYvPuDfCBf2wDxjCt0JDa 9qRJFznd+SS3lTAmUOHrebIg3k76/+MpBAOOvWR50brONSIeB1YCUml6o4nX2ILRUS9WqBsLYnsuG 6lYc128bU5H12QWocnItSFqW6oVXvBHcqge35cAvyw04VE0BJLIfovi/FLcaGhCPatzA=; Received: from 198-48-224-11.cpe.pppoe.ca ([198.48.224.11] helo=[192.168.1.180]) by mail.codeweavers.com with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lRYEr-0002D2-Uo; Wed, 31 Mar 2021 05:38:18 -0500 Subject: Re: [PATCH] perf data: export to JSON To: Jiri Olsa Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Namhyung Kim , Ian Rogers , Stephane Eranian , Tan Xiaojun , linux-kernel@vger.kernel.org References: <4687bbe5-4ff3-af3a-fcec-06d8bfe5591c@codeweavers.com> From: Nicholas Fraser Message-ID: <2d78b018-df5a-36cb-2f78-d3ca11bf9513@codeweavers.com> Date: Wed, 31 Mar 2021 06:38:16 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jiri, Thanks for the review. I've addressed your suggestions; some notes are below. I'll send a new patch. On 2021-03-24 2:20 p.m., Jiri Olsa wrote: > On Wed, Mar 24, 2021 at 09:06:50AM -0400, Nicholas Fraser wrote: >> [...] We use this to import the data into a tool on Windows >> where integrating perf or libbabeltrace is impractical. > > hi, > exciting ;-) and curious, which tool is that? > The tool is called gpuvis. The perf JSON parsing support is here: https://github.com/ludocode/gpuvis The idea is to be able to line up samples from perf with GPU trace events, so you can do things like timebox all perf samples in a particular frame of rendering. > we already have zstd support compiled in for compressing samples, > should be easy to use it for compressing the output of this right > away This would require that apps that consume this integrate zstd as well. It's simpler (both conceptually and from an integration standpoint) to just compress on command-line if you need with whatever compressor you want. You can even do this inline by writing to /dev/stdout, e.g.: perf data convert --to-json /dev/stdout --force | zstd > out.json.zstd Since we're transferring to Windows, more likely we'd output the JSON and then put it in a .zip container. > I understand not supporting opts.all or opts.tod, but 'force' > support means just assigning 'force' to struct perf_data It's not clear to me what 'force' does on 'struct perf_data' since we're only reading it. I assumed for data export it meant the output file should be overwritten. I've made it do both in the replacement patch. Nick