Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp3354188pxb; Tue, 20 Apr 2021 06:34:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyO4OrWIeQNdyaHIekZk2LfjJpKnAoiFV7RIpZqTQVn0C69KW0ZksAd3LGYMvT49gOiLPsc X-Received: by 2002:a17:906:c348:: with SMTP id ci8mr27813069ejb.303.1618925690339; Tue, 20 Apr 2021 06:34:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618925690; cv=none; d=google.com; s=arc-20160816; b=u0L4HHpxy915VPCptQ1RgVZe7j7YJUNDjQP+bBRA7GZRBXY/n+C/vcjPJGwHcAS9EQ pNpXkn4I/spCsPWKorGrPludxzG1Sf3dPhvp6a7ip63Cc8Ere3NSg0wl+C5IxYBZm/az dpDQf6X85k9bbC1EiofyaShOPmuKYyXlewkoMr+MMNTjpnA2KsbS6aYZK3zx5rktb4Tt Mxqn8dUaFfaK9YdNLi+6pxK3IAz9255bQqH5uo1OLvdBB4Ejb/1HIDsjX+lUkaI367Xc EscXttwG5n9SmxGHhckOvdC2w16+WvUOHxo/f9vS32lrdwITKezEOPHoV9TAT5pUDKkk R9zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=g3YcIppg7/ilVSy7kcLKtRaXPe1UXLqqSTnQUs0dEsU=; b=GHAaYV/ee65wDubp8Sq72d7MGeLIB7CxlWyd0jf7HZ2UK6KnlNTQ10AgobKvfBR0pU VNyhp+zHPlna/W4GSmlJ6DfD1f027bJIJf/V2louSgI/l7WgpNTuZl1BddkoIFdNknqp xJILsw+aBDomYyqZnrrEGndhAlzTrvdG6nIaGDukclEy6u1eU05TBwb0o4QsHoUVcbuU putMlaE3lxDZDJka0vv4xa6UQrv3DHxWimUyHDd1B2VdFJzcvNVIsUdTSeZSruGQwDtV GWYd4Kvymi2HTEmbHNx78eCwQpbaaX5keXrDUofHpib/AyUsc2NU9Kl1x0/0loyTHJta PdKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kepstin.ca header.s=google header.b=xW0uQ31J; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=kepstin.ca Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d26si13634777ejw.231.2021.04.20.06.34.26; Tue, 20 Apr 2021 06:34:50 -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=pass header.i=@kepstin.ca header.s=google header.b=xW0uQ31J; 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=pass (p=NONE sp=REJECT dis=NONE) header.from=kepstin.ca Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231422AbhDTNdN (ORCPT + 99 others); Tue, 20 Apr 2021 09:33:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232394AbhDTNdM (ORCPT ); Tue, 20 Apr 2021 09:33:12 -0400 Received: from mail-qk1-x733.google.com (mail-qk1-x733.google.com [IPv6:2607:f8b0:4864:20::733]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF2C7C06174A for ; Tue, 20 Apr 2021 06:32:40 -0700 (PDT) Received: by mail-qk1-x733.google.com with SMTP id i12so7735110qke.3 for ; Tue, 20 Apr 2021 06:32:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kepstin.ca; s=google; h=message-id:subject:from:to:cc:date:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=g3YcIppg7/ilVSy7kcLKtRaXPe1UXLqqSTnQUs0dEsU=; b=xW0uQ31JyQkmfx87N5TFQ85v8GxdnNyqvhaSpXF/WMzSdLtZ/oczOrDrd852nw8mZR OJVZU2gky+SEXyUU8KeEsY4q8YGc+4yi8Q2DJ0sFaHcBGwr34VSrgWOrp3r3IJVDFcCk PX+zSJ9GCWBeQFFrhTX6VVik2/5fGe7VJou1c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=g3YcIppg7/ilVSy7kcLKtRaXPe1UXLqqSTnQUs0dEsU=; b=nPDGZHD0gJbYSRTAbh5Rz5pL2GAc3Osk2Xu8NjzFwplYw5qtzwDMf2TmXgWai/B0Na vtxo3Y1PaG06kD3FUv3TXnPRbP8X/M0Ycs6lz82Wjf0R9J0+7N/IOYM3bcgOuJcMiysq EOtgnPVO9/vfhyXQW9TVspdisMWbnimHPRF10ZHsoIYrUPae/zJYI31CIPBe8fk30Hd8 d7wn1EcG/XoOLS1GcXhpBUozgoo/cEZ0oio2woh23pkSoyRUaOsrROMofvEcwCopY8IS xE7Ncq3LndTVXdsFhhf9kUdFAS6iQiq2BPNpeScpIGZj5Xa0KeNge2ZYMcS5Z84FcLgk XHPA== X-Gm-Message-State: AOAM5338De+1P80Jbm3EgbEZFz9RAeyDnorEKYwivHMXkz0x948FDMQe 5JJqaiyV4ptGch8fG/+q6jsETg== X-Received: by 2002:a37:be87:: with SMTP id o129mr6087298qkf.284.1618925560022; Tue, 20 Apr 2021 06:32:40 -0700 (PDT) Received: from saya.kepstin.ca (dhcp-108-168-125-232.cable.user.start.ca. [108.168.125.232]) by smtp.gmail.com with ESMTPSA id n143sm12601103qke.45.2021.04.20.06.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Apr 2021 06:32:39 -0700 (PDT) Message-ID: <2439425b90fb305cc1938fca22e22505851e9c08.camel@kepstin.ca> Subject: Re: [PATCH v2] tools/power turbostat: Fix RAPL summary collection on AMD processors From: Calvin Walton To: Terry Bowman , lenb@kernel.org, yu.c.chen@intel.com, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, bp@suse.de Cc: wei.huang2@amd.com Date: Tue, 20 Apr 2021 09:32:36 -0400 In-Reply-To: <20210419195812.147710-1-terry.bowman@amd.com> References: <20210419195812.147710-1-terry.bowman@amd.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 2021-04-19 at 14:58 -0500, Terry Bowman wrote: > Turbostat fails to correctly collect and display RAPL summary > information > on Family 17h and 19h AMD processors. Running turbostat on these > processors > returns immediately. If turbostat is working correctly then RAPL > summary > data is displayed until the user provided command completes. If a > command > is not provided by the user then turbostat is designed to > continuously > display RAPL information until interrupted. > > The issue is due to offset_to_idx() and idx_to_offset() missing > support for > AMD MSR addresses/offsets. offset_to_idx()'s switch statement is > missing > cases for AMD MSRs and idx_to_offset() does not include a path to > return > AMD MSR(s) for any idx. Ah, when I was looking at Boris's patch, it lead me to one more spot that was missed with the off_t type - inside the function update_msr_sum(), the offset is also stored in a variable of type int, and as a result the background update for AMD's MSR when turbostat is used with long durations won't work. (It's skipped because of the offset < 0 check). -- Calvin Walton