Skip to content

Commit

Permalink
[GR-44520] Add tracker that provides both max-rss and RSS percentiles.
Browse files Browse the repository at this point in the history
PullRequest: mx/1583
  • Loading branch information
peter-hofer committed Mar 29, 2023
2 parents 51f7a08 + d7b535a commit 739f6ab
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 15 deletions.
26 changes: 13 additions & 13 deletions common.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
"Jsonnet files should not include this file directly but use ci/common.jsonnet instead."
],

"mx_version": "6.17.0",
"mx_version": "6.18.0",

"COMMENT.jdks": "When adding or removing JDKs keep in sync with JDKs in ci/common.jsonnet",
"jdks": {
"oraclejdk11": {"name": "jpg-jdk", "version": "11.0.11", "build_id": "9", "release": true, "platformspecific": true, "extrabundles": ["static-libs"] },

"oraclejdk17": {"name": "jpg-jdk", "version": "17.0.1", "build_id": "12", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ce-17Debug": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ce-17": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-17Debug": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-17-llvm": {"name": "labsjdk", "version": "ce-17.0.7+4-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-17": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-17Debug": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-17-llvm": {"name": "labsjdk", "version": "ee-17.0.7+8-jvmci-23.0-b10-sulong", "platformspecific": true },

"oraclejdk19": {"name": "jpg-jdk", "version": "19", "build_id": "26", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-19": {"name": "labsjdk", "version": "ce-19.0.1+10-jvmci-23.0-b04", "platformspecific": true },
Expand All @@ -27,12 +27,12 @@
"labsjdk-ee-19-llvm": {"name": "labsjdk", "version": "ee-19.0.2+7-jvmci-23.0-b05-sulong", "platformspecific": true },

"oraclejdk20": {"name": "jpg-jdk", "version": "20", "build_id": "24", "release": true, "platformspecific": true, "extrabundles": ["static-libs"]},
"labsjdk-ce-20": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ce-20Debug": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ce-20-llvm": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b09-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.1+8-jvmci-23.0-b09-sulong", "platformspecific": true }
"labsjdk-ce-20": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ce-20Debug": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ce-20-llvm": {"name": "labsjdk", "version": "ce-20+34-jvmci-23.0-b10-sulong", "platformspecific": true },
"labsjdk-ee-20": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10", "platformspecific": true },
"labsjdk-ee-20Debug": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-debug", "platformspecific": true },
"labsjdk-ee-20-llvm": {"name": "labsjdk", "version": "ee-20.0.1+9-jvmci-23.0-b10-sulong", "platformspecific": true }
},

"eclipse": {
Expand Down
2 changes: 1 addition & 1 deletion mx.py
Original file line number Diff line number Diff line change
Expand Up @@ -18376,7 +18376,7 @@ def alarm_handler(signum, frame):
abort(1, killsig=signal.SIGINT)

# The version must be updated for every PR (checked in CI) and the comment should reflect the PR's issue
version = VersionSpec("6.18.0") # GR-45001 - enhanced fetch-jdk
version = VersionSpec("6.18.1") # GR-44520: sampling-based RSS percentiles

currentUmask = None
_mx_start_datetime = datetime.utcnow()
Expand Down
20 changes: 19 additions & 1 deletion mx_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -2668,7 +2668,7 @@ def map_command(self, cmd):
mx.abort("Memory tracking requires the 'psrecord' dependency. Install it with: 'pip install psrecord'")

self.most_recent_text_output = text_output
return ["psrecord", "--interval", "0.050", "--log", text_output, "--plot", plot_output, "--include-children", " ".join(cmd)]
return ["psrecord", "--interval", "0.1", "--log", text_output, "--plot", plot_output, "--include-children", " ".join(cmd)]

def get_rules(self, bmSuiteArgs):
return [PsrecordTracker.PsrecordRule(self, bmSuiteArgs)]
Expand Down Expand Up @@ -2712,9 +2712,27 @@ def pc(k): # k-percentile with linear interpolation between closest ranks
return [pc(100), pc(99), pc(95), pc(90), pc(75), pc(50), pc(25)]


class PsrecordMaxrssTracker(Tracker):
"""Uses both `time` for exact maximum RSS and `psrecord` for percentiles from sampling."""

def __init__(self, bmSuite):
super().__init__(bmSuite)
self.rss = RssTracker(bmSuite)
self.psrecord = PsrecordTracker(bmSuite)

def map_command(self, cmd):
# Note that psrecord tracks the metrics of the `time` tool as well, which adds 1-2M of RSS.
# Vice versa, `time` would track psrecord's Python interpreter, which adds more than 10M.
return self.psrecord.map_command(self.rss.map_command(cmd))

def get_rules(self, bmSuiteArgs):
return self.rss.get_rules(bmSuiteArgs) + self.psrecord.get_rules(bmSuiteArgs)


_available_trackers = {
"rss": RssTracker,
"psrecord": PsrecordTracker,
"psrecord+maxrss": PsrecordMaxrssTracker,
}


Expand Down

0 comments on commit 739f6ab

Please sign in to comment.