lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 4 Apr 2014 17:09:45 +0800
From:	Lei Wen <adrian.wenl@...il.com>
To:	noman pouigt <variksla@...il.com>
Cc:	john.stultz@...aro.org, Thomas Gleixner <tglx@...utronix.de>,
	Stephen Boyd <sboyd@...eaurora.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Steven Rostedt <rostedt@...dmis.org>,
	Michael Opdenacker <michael.opdenacker@...e-electrons.com>,
	Joe Perches <joe@...ches.com>, Petr Mladek <pmladek@...e.cz>,
	linux-kernel@...r.kernel.org, leiwen@...vell.com
Subject: Re: Query for time tracking between userspace and kernelspace

On Fri, Apr 4, 2014 at 3:02 PM, noman pouigt <variksla@...il.com> wrote:
> Hello,
>
> Probably this question belongs to kernelnewbies
> list but I think i will get accurate answer from here.
>
> I am doing some optimization in kernel video driver
> code to reduce the latency from the time buffer
> is given to the time it is displayed.
>
> Userspace:
> t1 = gettimeofday()
>
> Kernelspace:
> t2 = do_gettimeofday()
>
> Using debugfs i am copying t2 to userspace and
> subtracting the result.
>
> latency = t2 - t1
>
> Would this be accurate? I know there is context
> switch involved and other stuff but this is the method
> i came up with. Any better way?
>

Not sure whether it is accurate or not...
But from the code, gettimeofday syscall define in kernel/time.c
is also using the kernel's do_gettimeofday API, and then copy to
userspace, which shall not so different with your debugfs usage.

For better way, would this vDSO getimeofday could fulfill your need?
You may refer to: https://lwn.net/Articles/585203/

Thanks,
Lei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ