public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephen White <stephen-acpi-devel-4QvXXjU8Dv4@public.gmane.org>
To: Markus Gaugusch <markus-z+rTbpWsRgbk7+2FdBfRIA@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Sony Vaio Battery Info
Date: Fri, 20 Dec 2002 16:09:54 +0000	[thread overview]
Message-ID: <20021220160954.GA13548@the.earth.li> (raw)
In-Reply-To: <Pine.LNX.4.50.0212192106570.950-100000-KjnUIgV0B0bsKMwAuzqOxrNldLUNz+W/@public.gmane.org>

---- Original Message ----
> From Markus Gaugusch <markus-z+rTbpWsRgbk7+2FdBfRIA@public.gmane.org>
> Date: Thursday, 19 Dec 2002, 20:13
>
> I don't really know how to do this (finding the ec code won't be so hard,
> but I don't think that 'normal' libc time functions will work in kernel).
> Any volunteers? ;)

You shouldn't need to use the time functions .. just print out the
kernel's 'jiffy' count.  It's only 100Hz but since we're looking for
0.6s that shouldn't matter.

If you need debug timings more precisely then on x86:

#define _int64 long long // The kernel may have something like this already .. I can't remember
#define prectime() ({ _int64 u; asm("rdtsc": "=A" (u)); u; })

will give you a way of accessing the time stamp counter which on Pentium 
class chips will count CPU cycles .. which gives somewhat more precise 
profiling information.

This is something I keep meaning to look at, but I seem to be missing a 
large number of 'tuits' (especially the round variety).

-- 
Stephen White <stephen-acpi-devel-4QvXXjU8Dv4@public.gmane.org>


-------------------------------------------------------
This SF.NET email is sponsored by:  The Best Geek Holiday Gifts!
Time is running out!  Thinkgeek.com has the coolest gifts for
your favorite geek.   Let your fingers do the typing.   Visit Now.
T H I N K G E E K . C O M        http://www.thinkgeek.com/sf/

      parent reply	other threads:[~2002-12-20 16:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-19 20:13 Sony Vaio Battery Info Markus Gaugusch
     [not found] ` <Pine.LNX.4.50.0212192106570.950-100000-KjnUIgV0B0bsKMwAuzqOxrNldLUNz+W/@public.gmane.org>
2002-12-20  8:03   ` Malte Thoma
     [not found]     ` <3E02CEB5.9080506-xhPu7QH+N+StU9/U+hoEgQ@public.gmane.org>
2002-12-21 21:45       ` Pavel Machek
2002-12-20 16:09   ` Stephen White [this message]

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=20021220160954.GA13548@the.earth.li \
    --to=stephen-acpi-devel-4qvxxju8dv4@public.gmane.org \
    --cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    --cc=markus-z+rTbpWsRgbk7+2FdBfRIA@public.gmane.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