[Top] [All Lists]

Re: [PATCH v5 09/12] MIPS/Perf-events: replace pmu names with numeric

To: David Daney <>
Subject: Re: [PATCH v5 09/12] MIPS/Perf-events: replace pmu names with numeric IDs
From: Deng-Cheng Zhu <>
Date: Sat, 29 May 2010 11:13:19 +0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=ZLqDfxIOvbQDnT0tEXTHGGuddKmcsWd8hQs4tmmU/D4=; b=JFx/OKpnQUyIr2kQNzp2kDm4bei4BSIGOOlSurkiS9YAeq/j4PDiidhxztzzp96qEZ 6dCigKenZhS6WtXyAd07U7OA0b30VvEWRVfxh4ZggaZ3CcAsawRXZJ66a+8VXZ89ZG4O f5rW33qHSwCZdt6viCb6XJ4GTyOsd+S7ZcU0U=
Domainkey-signature: a=rsa-sha1; c=nofws;; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=c+Naf2pSDbTwTde4I4oyEh3GBSiqcXbR6AOBEULGzW1JLzpFtx3ycuYLvgqF4voHob jcfgBW7zeYhJlPK0vIF+ltDD0JdZT8i3pCxM/4+6JZcF5HQd7OFhg1WPL7gYda/QQTy+ YSu5k56THJG3unE1zut35Pro2bIHuig1awr/o=
In-reply-to: <>
Original-recipient: rfc822;
References: <> <> <>
2010/5/28 David Daney <>:
> I don't like this one.
> In cpu-probe.c we used to have this same type of parallel name array, and it
> was messy.
> You know what type of cpu you are running on, so I don't understand the
> advantage of querying by name.  What possible use could there be to knowing
> the names of processors that are not applicable to the current runtime?
1) It's not "querying by name", but "querying name by enum numbers".
2) Oprofile (now a client of Perf-events) needs to print out the PMU names
to the user. If we don't want this patch, we have 2 methods to do this:
- Export the whole mipspmu, and use mipspmu->name;
- Like the old Oprofile (mipsxx), do a 2nd "switch(current_cpu_type())",
the 1st is in perf_event_mipsxx.c init_hw_perf_events().
3) Exporting a single name array indexed by enum IDs should be convenient
for maintaince. Maybe I'm missing some considerations... But how do we
allow Oprofile to get the string name to the user? Not even need to do it?


<Prev in Thread] Current Thread [Next in Thread>