diff options
author | Mike McLaughlin <mikem@microsoft.com> | 2019-05-29 23:39:31 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-29 23:39:31 -0700 |
commit | e46ae5921c510309f252af21c2a88d341e4e15ab (patch) | |
tree | 53b273bfed5e8310d50b38daf2067a77f3589b2f /src/pal | |
parent | cc1f8ab68e645cd46601b1df50ff644dfffc4dae (diff) | |
download | coreclr-e46ae5921c510309f252af21c2a88d341e4e15ab.tar.gz coreclr-e46ae5921c510309f252af21c2a88d341e4e15ab.tar.bz2 coreclr-e46ae5921c510309f252af21c2a88d341e4e15ab.zip |
Use /proc/<pid>/mem to read memory in remote DBI data target. It makes the test case run at (#24844)
least 4 to 5 times faster than before.
Fallback to old transport ReadMemory if /proc/<pid>/mem can't be opened. This happens
on attach because of permissions/access, but works fine on the launch (the most
important case).
Diffstat (limited to 'src/pal')
-rw-r--r-- | src/pal/inc/pal.h | 5 | ||||
-rw-r--r-- | src/pal/src/cruntime/file.cpp | 12 |
2 files changed, 16 insertions, 1 deletions
diff --git a/src/pal/inc/pal.h b/src/pal/inc/pal.h index bcb4e8ce8f..884b737d15 100644 --- a/src/pal/inc/pal.h +++ b/src/pal/inc/pal.h @@ -4138,6 +4138,7 @@ PAL_GetCurrentThreadAffinitySet(SIZE_T size, UINT_PTR* data); #define _strdup PAL__strdup #define _getcwd PAL__getcwd #define _open PAL__open +#define _pread PAL__pread #define _close PAL__close #define _wcstoui64 PAL__wcstoui64 #define _flushall PAL__flushall @@ -4507,7 +4508,9 @@ PALIMPORT char * __cdecl ctime(const time_t *); #endif // !PAL_STDCPP_COMPAT PALIMPORT int __cdecl _open_osfhandle(INT_PTR, int); -PALIMPORT int __cdecl _close(int); +PALIMPORT DLLEXPORT int __cdecl _open(const char *szPath, int nFlags, ...); +PALIMPORT DLLEXPORT size_t __cdecl _pread(int fd, void *buf, size_t nbytes, ULONG64 offset); +PALIMPORT DLLEXPORT int __cdecl _close(int); PALIMPORT DLLEXPORT int __cdecl _flushall(); #ifdef PAL_STDCPP_COMPAT diff --git a/src/pal/src/cruntime/file.cpp b/src/pal/src/cruntime/file.cpp index 0eb2cea151..c54e3e0418 100644 --- a/src/pal/src/cruntime/file.cpp +++ b/src/pal/src/cruntime/file.cpp @@ -453,6 +453,18 @@ PAL_FILE * __cdecl PAL_get_stderr(int caller) return &PAL_Stderr; } +/*++ + +Function: + + PAL_pread + +See msdn for more details. +--*/ +size_t __cdecl PAL__pread(int fd, void *buf, size_t nbytes, ULONG64 offset) +{ + return pread(fd, buf, nbytes, offset); +} /*++ |