netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@muc.de>
To: netdev@oss.sgi.com
Subject: [PATCH] Remove X86_TSC dependency in net profile code
Date: Wed, 3 Sep 2003 01:00:57 +0200	[thread overview]
Message-ID: <20030902230057.GA5424@averell> (raw)


This removes one of the remaining users of CONFIG_X86_TSC

Replace it with a runtime test instead. In some configurations it 
will be still properly optimized because cpu_has_tsc will expand
to a constant then.

This also makes it handle x86-64.

I did not actually compile test this because net profile is commented
out since a long time and doesn't compile. An alternative if noone comes
up to fix it would be just to remove it completely.

-Andi

--- linux-2.6.0test4/include/net/profile.h-o	2003-05-27 03:00:21.000000000 +0200
+++ linux-2.6.0test4/include/net/profile.h	2003-08-29 19:48:11.000000000 +0200
@@ -29,11 +29,14 @@
 extern struct timeval net_profile_adjust;
 extern void net_profile_irq_adjust(struct timeval *entered, struct timeval* leaved);
 
-#ifdef CONFIG_X86_TSC
+#ifdef CONFIG_X86
 
 static inline void  net_profile_stamp(struct timeval *pstamp)
 {
-	rdtsc(pstamp->tv_usec, pstamp->tv_sec);
+	if (cpu_has_tsc)
+		rdtsc(pstamp->tv_usec, pstamp->tv_sec);
+	else
+		do_gettimeofday(pstamp);
 }
 
 static inline void  net_profile_accumulate(struct timeval *entered,

             reply	other threads:[~2003-09-02 23:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-02 23:00 Andi Kleen [this message]
2003-09-02 22:57 ` [PATCH] Remove X86_TSC dependency in net profile code David S. Miller
2003-09-04  7:44 ` David S. Miller

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=20030902230057.GA5424@averell \
    --to=ak@muc.de \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).