Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Earl Chew <echew@ixiacom.com>
To: <linux-mips@linux-mips.org>
Subject: Publishing mips_hpt_frequency in /proc/cpuinfo
Date: Thu, 27 Jan 2011 20:59:55 -0800	[thread overview]
Message-ID: <4D424D4B.5090002@ixiacom.com> (raw)

The CPU frequency is known to the Linux kernel. For example:

> CPU revision is: 00019374 (MIPS 24Kc)
> Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
> ...
> Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)

Unfortunately that information is not available from userspace:

> cpu model               : MIPS 24Kc V7.4
> BogoMIPS                : 452.19

This makes it difficult to use CPU timers (rdhwr) from user space
applications.


Is there any reason not to publish mips_hpt_frequency in /proc/cpuinfo ?


Earl


--- proc.c      2011-01-17 14:05:16.397444347 -0800
+++ /tmp/proc.c 2011-01-27 20:56:18.807454356 -0800
@@ -43,6 +43,9 @@
        seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
                      cpu_data[n].udelay_val / (500000/HZ),
                      (cpu_data[n].udelay_val / (5000/HZ)) % 100);
+       seq_printf(m, "timer frequency\t: %u.%03u\n",
+                     mips_hpt_frequency / 1000000,
+                     mips_hpt_frequency % 1000000 / 1000);
        seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
        seq_printf(m, "microsecond timers\t: %s\n",
                      cpu_has_counter ? "yes" : "no");

WARNING: multiple messages have this Message-ID (diff)
From: Earl Chew <echew@ixiacom.com>
To: linux-mips@linux-mips.org
Subject: Publishing mips_hpt_frequency in /proc/cpuinfo
Date: Thu, 27 Jan 2011 20:59:55 -0800	[thread overview]
Message-ID: <4D424D4B.5090002@ixiacom.com> (raw)
Message-ID: <20110128045955.H8zTYxcowuvsVlU0ViJYTXyLDsK_OOcFl878W34AP40@z> (raw)

The CPU frequency is known to the Linux kernel. For example:

> CPU revision is: 00019374 (MIPS 24Kc)
> Atheros AR7161 rev 2, CPU:680.000 MHz, AHB:170.000 MHz, DDR:340.000 MHz
> ...
> Calibrating delay loop... 452.19 BogoMIPS (lpj=2260992)

Unfortunately that information is not available from userspace:

> cpu model               : MIPS 24Kc V7.4
> BogoMIPS                : 452.19

This makes it difficult to use CPU timers (rdhwr) from user space
applications.


Is there any reason not to publish mips_hpt_frequency in /proc/cpuinfo ?


Earl


--- proc.c      2011-01-17 14:05:16.397444347 -0800
+++ /tmp/proc.c 2011-01-27 20:56:18.807454356 -0800
@@ -43,6 +43,9 @@
        seq_printf(m, "BogoMIPS\t\t: %u.%02u\n",
                      cpu_data[n].udelay_val / (500000/HZ),
                      (cpu_data[n].udelay_val / (5000/HZ)) % 100);
+       seq_printf(m, "timer frequency\t: %u.%03u\n",
+                     mips_hpt_frequency / 1000000,
+                     mips_hpt_frequency % 1000000 / 1000);
        seq_printf(m, "wait instruction\t: %s\n", cpu_wait ? "yes" : "no");
        seq_printf(m, "microsecond timers\t: %s\n",
                      cpu_has_counter ? "yes" : "no");

             reply	other threads:[~2011-01-28  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-28  4:59 Earl Chew [this message]
2011-01-28  4:59 ` Publishing mips_hpt_frequency in /proc/cpuinfo Earl Chew
2011-01-28 10:57 ` Ralf Baechle
2011-01-28 12:28   ` Thomas Gleixner
2011-01-28 15:29     ` Earl Chew

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=4D424D4B.5090002@ixiacom.com \
    --to=echew@ixiacom.com \
    --cc=linux-mips@linux-mips.org \
    /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