-/* Copyright (C) 2011-2014 Oracle, Inc. */
+/* Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. */
#ifndef _LINUX_DTRACE_OS_H_
#define _LINUX_DTRACE_OS_H_
extern dtrace_vtime_state_t dtrace_vtime_active;
+extern ktime_t dtrace_get_walltime(void);
+
extern void dtrace_vtime_enable(void);
extern void dtrace_vtime_disable(void);
extern void dtrace_vtime_switch(struct task_struct *, struct task_struct *);
* FILE: dtrace_os.c
* DESCRIPTION: Dynamic Tracing: OS support functions - part of kernel core
*
- * Copyright (C) 2010-2014 Oracle Corporation
+ * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved.
*/
#include <linux/binfmts.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/stacktrace.h>
+#include <linux/timekeeping.h>
#include <linux/vmalloc.h>
#include <linux/kallsyms.h>
#include <linux/workqueue.h>
\*---------------------------------------------------------------------------*/
dtrace_vtime_state_t dtrace_vtime_active = 0;
+ktime_t dtrace_get_walltime(void)
+{
+ struct timespec t = __current_kernel_time();
+
+ return ns_to_ktime(timespec64_to_ns(&t));
+}
+EXPORT_SYMBOL(dtrace_get_walltime);
+
void dtrace_vtime_enable(void)
{
dtrace_vtime_state_t old, new;