From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D7ECC48BDF for ; Tue, 15 Jun 2021 11:03:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6783461456 for ; Tue, 15 Jun 2021 11:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230081AbhFOLFq (ORCPT ); Tue, 15 Jun 2021 07:05:46 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:30217 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229937AbhFOLFp (ORCPT ); Tue, 15 Jun 2021 07:05:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1623755021; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iEAQAQmkLLT7lE0HbV2Awm5nECfUPpZCvFSfqi2dN24=; b=dgU/gWK0iVVvZnA7dQMnHYQsjxQh186wjN2Y59+jDfpuXAi/C/jQh59iVs45YCtdWpeh2I WrIv/ZsxXitFxUTtDE/jZE4TT4Vk8D5ShGgDY8cmAfLeptx4Hgcc8dVnzpShkbedDH9GFW R2+QwFP8emCv4zImix8NIEAkmpUGA1g= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-RVFs_IHWNMyNCvVOlMupSg-1; Tue, 15 Jun 2021 07:03:40 -0400 X-MC-Unique: RVFs_IHWNMyNCvVOlMupSg-1 Received: by mail-ed1-f71.google.com with SMTP id dd28-20020a056402313cb029038fc9850034so22019090edb.7 for ; Tue, 15 Jun 2021 04:03:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:cc:references:from:subject:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=iEAQAQmkLLT7lE0HbV2Awm5nECfUPpZCvFSfqi2dN24=; b=ZtEeP65zbEOgNxyIFog/2zXWl/SMgP3wvgF3mHP6A9DJdJ2YYVRuSXArUWFohapP0i 3Z5oIuR1XfNfBqy5M/tsGwPhxD61Mpo0lKLSApe5ee3XDnxXNk5P+5j+VOnp8xIZTAY6 riW+cGnnwQwaaBkL2F5YHgXCOXgxtdTM9qLZt/Q0Sf9TBo4eU28ftWeEFH6khuo0rrOM Xokm7Qby5SpxOCg+7vp67prHIaTg8TUCtWReIgjSbouWoYvxxo7Z2WBRzU/ldDUMlhaJ /lyp0NW2vWMNJvhh+AS1+68nZYVDlZ769xgxSeTcdcM0e3hXGVTms+NULWXR8seUXPKR sPkg== X-Gm-Message-State: AOAM531Aoa9Ud1SwWHv4Dffb6ceAgwjMwDprdJWGiXZWbrTU1zLWQ9U4 1mcTUQSzfdMFrClxI8AxOYdT+q0tORk5h5KIZArePet1VHinM6N5B9AyLMpLgUJ80XwTkr7/i8Q pDe6eTaJXBmv3yCJAIuHV/f00JjQ6 X-Received: by 2002:aa7:cb90:: with SMTP id r16mr22601045edt.121.1623755019169; Tue, 15 Jun 2021 04:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyyVGoTcEFV+m9u1f3g2PKtrTco2TK6Sy4Mfoi+BgNSLuNotL7Uvem+oaDEtZ7dwo5Mk49IJg== X-Received: by 2002:aa7:cb90:: with SMTP id r16mr22601014edt.121.1623755018970; Tue, 15 Jun 2021 04:03:38 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id h8sm10123527ejj.22.2021.06.15.04.03.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Jun 2021 04:03:38 -0700 (PDT) To: Leon Romanovsky Cc: Jing Zhang , KVM , KVMARM , LinuxMIPS , KVMPPC , LinuxS390 , Linuxkselftest , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Will Deacon , Huacai Chen , Aleksandar Markovic , Thomas Bogendoerfer , Paul Mackerras , Christian Borntraeger , Janosch Frank , David Hildenbrand , Cornelia Huck , Claudio Imbrenda , Sean Christopherson , Vitaly Kuznetsov , Jim Mattson , Peter Shier , Oliver Upton , David Rientjes , Emanuele Giuseppe Esposito , David Matlack , Ricardo Koller , Krish Sadhukhan , Fuad Tabba References: <20210614212155.1670777-1-jingzhangos@google.com> <15875c41-e1e7-3bf2-a85c-21384684d279@redhat.com> From: Paolo Bonzini Subject: Re: [PATCH v9 0/5] KVM statistics data fd-based binary interface Message-ID: <9df462c0-e0ea-8173-0705-369d6a81107c@redhat.com> Date: Tue, 15 Jun 2021 13:03:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 15/06/21 09:53, Leon Romanovsky wrote: >> Sorry for my naive questions, but how does telemetry get statistics >> for hypervisors? Why is KVM different from hypervisors or NIC's statistics >> or any other high speed devices (RDMA) that generate tons of data? > > So the answer to the question "why KVM is different" is that it doesn't > have any stable identification except file descriptor. While hypervisors > have stable names, NICs and RDMA devices have interface indexes etc. > Did I get it right? Right. > And this was second part of my question, the first part was my attempt to > get on answer why current statistics like process info (/proc/xxx/*), NICs > (netlink) and RDMA (sysfs) are not using binary format. NICs are using binary format (partly in struct ethtool_stats, partly in an array of u64). For KVM we decided to put the schema and the stats in the same file (though you can use pread to get only the stats) to have a single interface and avoid ioctls, unlike having both ETH_GSTRINGS and ETH_GSTATS. I wouldn't say processes are using any specific format. There's a mix of "one value per file" (e.g. cpuset), human-readable tabular format (e.g. limits, sched), human- and machine-readable tabular format (e.g. status), and files that are ASCII but not human-readable (e.g. stat). Paolo