From: Darren Hart <dvhart@infradead.org>
To: "Chakravarty, Souvik K" <souvik.k.chakravarty@intel.com>
Cc: Rafael Wysocki <rjw@rjwysocki.net>,
"platform-driver-x86@vger.kernel.org"
<platform-driver-x86@vger.kernel.org>,
"Kasagar, Srinidhi" <srinidhi.kasagar@intel.com>,
"Zha, Qipeng" <qipeng.zha@intel.com>,
"Muralidhar, Rajeev D" <rajeev.d.muralidhar@intel.com>,
"Ghorai, Sukumar" <sukumar.ghorai@intel.com>,
"Yu, Ong Hock" <ong.hock.yu@intel.com>,
"Li, Aubrey" <aubrey.li@intel.com>
Subject: Re: [PATCH v2 4/5] platform:x86: Add Intel Telemetry Debugfs interfaces
Date: Tue, 29 Dec 2015 23:26:13 -0800 [thread overview]
Message-ID: <20151230072613.GF29978@malice.jf.intel.com> (raw)
In-Reply-To: <5F7315E704FA0841B5DFCE90329B2BB42B74AE95@BGSMSX105.gar.corp.intel.com>
On Wed, Dec 30, 2015 at 04:48:42AM +0000, Chakravarty, Souvik K wrote:
>
>
> > -----Original Message-----
> > From: platform-driver-x86-owner@vger.kernel.org [mailto:platform-driver-
> > x86-owner@vger.kernel.org] On Behalf Of Darren Hart
> > Sent: Wednesday, December 30, 2015 6:20 AM
> > To: Chakravarty, Souvik K <souvik.k.chakravarty@intel.com>; Rafael Wysocki
> > <rjw@rjwysocki.net>
> > Cc: platform-driver-x86@vger.kernel.org; Kasagar, Srinidhi
> > <srinidhi.kasagar@intel.com>; Zha, Qipeng <qipeng.zha@intel.com>;
> > Muralidhar, Rajeev D <rajeev.d.muralidhar@intel.com>; Ghorai, Sukumar
> > <sukumar.ghorai@intel.com>; Yu, Ong Hock <ong.hock.yu@intel.com>; Li,
> > Aubrey <aubrey.li@intel.com>
> > Subject: Re: [PATCH v2 4/5] platform:x86: Add Intel Telemetry Debugfs
> > interfaces
> >
> > On Wed, Dec 23, 2015 at 04:14:16PM +0530, Souvik Kumar Chakravarty wrote:
...
> > What is the plan for supporting future SoCs here? You have APL incorporated
> > into this file. Do you intend to add each generation to this file?
>
> Yes that is the intention.
OK, I guess we'll see how it scales and how many SoC generations follow with
this interface.
...
> >
> > > + d3_sts[idx] =
> > > + (evtlog[index].telem_evtlog >>
> > > + debugfs_conf->ioss_d0ix_data[idx].bit_pos)
> > &
> > > + TELEM_MASK_BIT;
> >
> > By the time you have indented 4, and really should be 5, the preference is to
> > determine if this can be refactored into a shallower nesting structure.
> >
> > Perhaps a macro of some sort as these all seem fairly repetitive.
>
> We can get in a macro or inline function, something like this:
> for (index = 0; index < ret; index++) {
> seq_printf(s, "%-32s %llu\n",
> name[index], evtlog[index].telem_evtlog);
>
> if (evtlog[index].telem_evtid == debugfs_conf->pss_idle_id)
> TELEM_PARSE_LOG(debugfs_conf->ioss_d3_id, debugfs_conf->ioss_d0ix_evts , d3_sts , debugfs_conf->ioss_d0ix_data)
> If.....
>
With a shorter alians for debugfs_conf, something like this is much more legible
and far less repetitive (easier to maintain).
> }
>
> #define TELEM_PARSE_LOG (EVTS, BUF, EVT_DATA) \
> for (int idx = 0; idx < EVTS; idx++) \
> BUF[idx] = (evtlog[index].telem_evtlog >> EVT_DATA[idx].bit_pos) & TELEM_MASK_BIT; \
> continue; \
>
> And something on the same lines for parsing counters.
>
> Or we could have TELEM_CHECK_AND_PARSE where even the 'if' is moved inside the macro.
> Does that look OK?
I think the above will work, but if you think you can remove some of the
redundancy with a CHECK_AND_PARSE without obfuscating the logic too much, give
it a shot.
--
Darren Hart
Intel Open Source Technology Center
next prev parent reply other threads:[~2015-12-30 7:26 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-23 10:44 [PATCH v2 4/5] platform:x86: Add Intel Telemetry Debugfs interfaces Souvik Kumar Chakravarty
2015-12-30 0:50 ` Darren Hart
2015-12-30 2:12 ` Rafael J. Wysocki
2015-12-30 3:03 ` Chakravarty, Souvik K
2015-12-30 7:13 ` Darren Hart
2015-12-30 4:48 ` Chakravarty, Souvik K
2015-12-30 7:26 ` Darren Hart [this message]
2015-12-30 3:30 ` Chakravarty, Souvik K
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151230072613.GF29978@malice.jf.intel.com \
--to=dvhart@infradead.org \
--cc=aubrey.li@intel.com \
--cc=ong.hock.yu@intel.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=qipeng.zha@intel.com \
--cc=rajeev.d.muralidhar@intel.com \
--cc=rjw@rjwysocki.net \
--cc=souvik.k.chakravarty@intel.com \
--cc=srinidhi.kasagar@intel.com \
--cc=sukumar.ghorai@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox