mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 17:48:54 +08:00
clang/gcov: Add a way to directly dump memory address
Signed-off-by: wangmingrong1 <wangmingrong1@xiaomi.com>
This commit is contained in:
committed by
Xiang Xiao
parent
a73217d1d6
commit
47e33c6433
@@ -161,6 +161,20 @@ extern void __gcov_filename_to_gcfn(FAR const char *filename,
|
|||||||
FAR void *),
|
FAR void *),
|
||||||
FAR void *arg);
|
FAR void *arg);
|
||||||
|
|
||||||
|
/****************************************************************************
|
||||||
|
* Name: __gcov_dump_to_memory
|
||||||
|
*
|
||||||
|
* Description:
|
||||||
|
* Dump gcov data directly to memory
|
||||||
|
*
|
||||||
|
* Parameters:
|
||||||
|
* ptr - Memory Address
|
||||||
|
* size - Memory block size
|
||||||
|
*
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
size_t __gcov_dump_to_memory(FAR void *ptr, size_t size);
|
||||||
|
|
||||||
#undef EXTERN
|
#undef EXTERN
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -324,6 +324,15 @@ void __gcov_dump(void)
|
|||||||
_NX_CLOSE(fd);
|
_NX_CLOSE(fd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t __gcov_dump_to_memory(FAR void *ptr, size_t size)
|
||||||
|
{
|
||||||
|
struct lib_memoutstream_s stream;
|
||||||
|
|
||||||
|
lib_memoutstream(&stream, ptr, size);
|
||||||
|
|
||||||
|
return __llvm_profile_dump(&stream.common);
|
||||||
|
}
|
||||||
|
|
||||||
void __gcov_reset(void)
|
void __gcov_reset(void)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user