[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Thomas Lehwald <thomas.lehwald@Ruetz.de>] (fwd)
- To: rtl@rtlinux.org
- Subject: BOUNCE rtl@rtlinux.org: Approval required: Non-member submissionfrom [Thomas Lehwald <thomas.lehwald@Ruetz.de>] (fwd)
- From: Der Herr Hofrat <der.herr@hofr.at>
- Date: Thu, 31 May 2001 06:29:03 +0200 (CEST)
>From owner-rtl Wed May 30 03:34:42 2001
Received: from central.webforum.de (central.webforum.de [193.141.169.166])
by hq.fsmlabs.com (8.11.2/8.11.2) with ESMTP id f4U9Yfs32091
for <rtl@fsmlabs.com>; Wed, 30 May 2001 03:34:42 -0600
Received: (from smap@localhost) by central.webforum.de (8.7.6/8.7.6-webforum) id LAA28041 for <rtl@fsmlabs.com>; Wed, 30 May 2001 11:29:31 +0200
Received: from exchange.ruetz.de(192.168.53.2)
via SMTP by central.webforum.de, id smtpda28033; Wed May 30 09:29:21 2001
Received: by EXCHANGE with Internet Mail Service (5.5.2448.0)
id <KQPB6WGT>; Wed, 30 May 2001 11:23:07 +0200
Message-ID: <5194C7501DC8D311A7DA00C0F015DD9111FCBD@EXCHANGE>
From: Thomas Lehwald <thomas.lehwald@Ruetz.de>
To: "'rtl@fsmlabs.com'" <rtl@fsmlabs.com>
Subject: Negative values from output of rtl_printf
Date: Wed, 30 May 2001 11:23:03 +0200
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2448.0)
Content-Type: text/plain;
charset="iso-8859-1"
Hi,
I have a question about the formatter %Ld of rtl_printf (printk). The man
page gave me the hint, that this formatter is supported under linux and will
fomat long long values (i.e. 64 bit int's) into strings for console output.
In my case this works only with integers equal or smaller than 0xFFFFFFFF
and with the "u" for unsigned. I discover the problem, if I tryed to
calculate timing differences. Example:
------------------------------
hrtime_t t1, t2;
t1 = clock_gethrtime(CLOCK_RTL_SCHED);
.... // do something
usleep(300); // sleep in example for 300 microsecs
t2 = clock_gethrtime(CLOCK_RTL_SCHED);
rtl_printf("Start=[%Ld] End=[%Ld] Diff=[%Ld]\n", t1, t2, t2-t1);
------------------------------
If t1 and t2 fits into 32 bits (unsigned long) all seems to be ok otherwise
I get negative values at output. Has anybody an explanation for this
behavior??
At the second, I'am not sure now, if the calculated difference is ok. I will
check this tody, because the schowing value is also not plausible (in the
example above: expected a little bit more than the sleeping time of 300
microsecs, may be 3xx xxx and got: 4732???)
My equipment: Pentium III, 256MB Ram, Mandrake 7.2, RTLinux-3.0 and
prepatched kernel 2.2.18 from fsmlab.
Thanks
Thomas
**************************************************************
Dipl.-Ing. (FH)
Thomas Lehwald
RUETZ Technologies Tel: 089 / 3 56 10 - 268
Abteilung E-Technik Fax: 089 / 3 56 10 - 111
Ingolstaedter Strasse 18 80807 Muenchen
email: thomas.lehwald@ruetz.de
****************************************************