Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
ec951cdc
Unverified
Commit
ec951cdc
authored
Dec 06, 2020
by
David CARLIER
Committed by
GitHub
Dec 06, 2020
Browse files
Solaris based system rss size report. (#8138)
parent
e288430c
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/config.h
View file @
ec951cdc
...
@@ -87,6 +87,7 @@
...
@@ -87,6 +87,7 @@
#include <sys/feature_tests.h>
#include <sys/feature_tests.h>
#ifdef _DTRACE_VERSION
#ifdef _DTRACE_VERSION
#define HAVE_EVPORT 1
#define HAVE_EVPORT 1
#define HAVE_PSINFO 1
#endif
#endif
#endif
#endif
...
...
src/zmalloc.c
View file @
ec951cdc
...
@@ -433,6 +433,27 @@ size_t zmalloc_get_rss(void) {
...
@@ -433,6 +433,27 @@ size_t zmalloc_get_rss(void) {
return
0L
;
return
0L
;
}
}
#elif defined(HAVE_PSINFO)
#include <unistd.h>
#include <sys/procfs.h>
#include <fcntl.h>
size_t
zmalloc_get_rss
(
void
)
{
struct
prpsinfo
info
;
char
filename
[
256
];
int
fd
;
snprintf
(
filename
,
256
,
"/proc/%d/psinfo"
,
getpid
());
if
((
fd
=
open
(
filename
,
O_RDONLY
))
==
-
1
)
return
0
;
if
(
ioctl
(
fd
,
PIOCPSINFO
,
&
info
)
==
-
1
)
{
close
(
fd
);
return
0
;
}
close
(
fd
);
return
info
.
pr_rssize
;
}
#else
#else
size_t
zmalloc_get_rss
(
void
)
{
size_t
zmalloc_get_rss
(
void
)
{
/* If we can't get the RSS in an OS-specific way for this system just
/* If we can't get the RSS in an OS-specific way for this system just
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment