2019-03-29 09:40:29 +00:00
|
|
|
/*
|
|
|
|
* \brief Trace timestamp
|
|
|
|
* \author Stefan Kalkowski
|
2019-06-04 19:17:10 +00:00
|
|
|
* \author Sebastian Sumpf
|
2019-03-29 09:40:29 +00:00
|
|
|
* \date 2019-03-25
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Genode Labs GmbH
|
|
|
|
*
|
|
|
|
* This file is part of the Genode OS framework, which is distributed
|
|
|
|
* under the terms of the GNU Affero General Public License version 3.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _INCLUDE__SPEC__ARM_64__TRACE__TIMESTAMP_H_
|
|
|
|
#define _INCLUDE__SPEC__ARM_64__TRACE__TIMESTAMP_H_
|
|
|
|
|
|
|
|
#include <base/fixed_stdint.h>
|
|
|
|
|
|
|
|
namespace Genode { namespace Trace {
|
|
|
|
|
2020-01-13 14:06:26 +00:00
|
|
|
typedef uint64_t Timestamp;
|
2019-03-29 09:40:29 +00:00
|
|
|
|
|
|
|
inline Timestamp timestamp()
|
|
|
|
{
|
2019-06-04 19:17:10 +00:00
|
|
|
uint64_t t;
|
|
|
|
/* cycle counter */
|
|
|
|
asm volatile("mrs %0, pmccntr_el0" : "=r" (t));
|
|
|
|
return t;
|
2019-03-29 09:40:29 +00:00
|
|
|
}
|
|
|
|
} }
|
|
|
|
|
|
|
|
#endif /* _INCLUDE__SPEC__ARM_64__TRACE__TIMESTAMP_H_ */
|