⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 286562 in webkit


Ignore:
Timestamp:
Dec 6, 2021, 1:01:35 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[RAMification] Add support for dumping smaps rollups on Linux
https://bugs.webkit.org/show_bug.cgi?id=233867

Patch by Zan Dobersek <zdobersek@igalia.com> on 2021-12-06
Reviewed by Yusuke Suzuki.

Add the option to dump smaps rollup after the end of each RAMification
test case. This mirrors the vmmap functionality and is implemented
alongside that option.

Once the jsc binary is left idle after the test case run, the
smaps_rollup output for the given jsc process is collected from the
proc filesystem. This material is then printed out after the test
is done, following the memory footprint dump.

For now this prefers the smaps_rollup instead of the complete smaps.
In this form, it already gives a good insight into the balance between
the proportional and residential set size amounts. Complete smaps could
be beneficial later, especially if we can implement differentiation
between allocations of different types and/or purposes.

  • JetStream2/RAMification.py:

(parseArgs):
(BaseRunner.init):
(BaseRunner.getResults):
(LocalRunner.runOneTest):
(main):
(main.runTestList):

Location:
trunk/PerformanceTests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/PerformanceTests/ChangeLog

    r286108 r286562  
     12021-12-06  Zan Dobersek  <zdobersek@igalia.com>
     2
     3        [RAMification] Add support for dumping smaps rollups on Linux
     4        https://bugs.webkit.org/show_bug.cgi?id=233867
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Add the option to dump smaps rollup after the end of each RAMification
     9        test case. This mirrors the vmmap functionality and is implemented
     10        alongside that option.
     11
     12        Once the jsc binary is left idle after the test case run, the
     13        smaps_rollup output for the given jsc process is collected from the
     14        proc filesystem. This material is then printed out after the test
     15        is done, following the memory footprint dump.
     16
     17        For now this prefers the smaps_rollup instead of the complete smaps.
     18        In this form, it already gives a good insight into the balance between
     19        the proportional and residential set size amounts. Complete smaps could
     20        be beneficial later, especially if we can implement differentiation
     21        between allocations of different types and/or purposes.
     22
     23        * JetStream2/RAMification.py:
     24        (parseArgs):
     25        (BaseRunner.__init__):
     26        (BaseRunner.getResults):
     27        (LocalRunner.runOneTest):
     28        (main):
     29        (main.runTestList):
     30
    1312021-11-21  Cathie Chen  <cathiechen@igalia.com>
    232
  • trunk/PerformanceTests/JetStream2/RAMification.py

    r277853 r286562  
    4444peakFootprintRE = re.compile(r"Peak Footprint: (\d+(?:.\d+)?)")
    4545
    46 TestResult = collections.namedtuple("TestResult", ["name", "returnCode", "footprint", "peakFootprint", "vmmapOutput"])
     46TestResult = collections.namedtuple("TestResult", ["name", "returnCode", "footprint", "peakFootprint", "vmmapOutput", "smapsOutput"])
    4747
    4848ramification_dir = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
     
    122122    parser.add_argument("-o", "--output", dest="jsonFilename", type=str, default=None, metavar="JSON-output-file", help="Path to JSON output")
    123123    parser.add_argument("-m", "--vmmap", dest="takeVmmap", action="store_true", default=False, help="Take a vmmap after each test")
     124    parser.add_argument("--smaps", dest="takeSmaps", action="store_true", default=False, help="Take a smaps rollup after each test")
    124125
    125126    args = parser.parse_args()
     
    148149        self.rootDir = args.testDir
    149150        self.environmentVars = {}
    150         self.vmmapOutput = ""
     151        self.vmmapOutput = "" if args.takeVmmap else None
     152        self.smapsOutput = "" if args.takeSmaps else None
    151153
    152154    def setup(self):
     
    181183
    182184    def getResults(self):
    183         return TestResult(name=self.testName, returnCode=self.returnCode, footprint=self.footprint, peakFootprint=self.peakFootprint, vmmapOutput=self.vmmapOutput)
     185        return TestResult(name=self.testName, returnCode=self.returnCode, footprint=self.footprint, peakFootprint=self.peakFootprint, vmmapOutput=self.vmmapOutput, smapsOutput=self.smapsOutput)
    184186
    185187
     
    212214
    213215            if "js shell waiting for input to exit" in line:
    214                 self.vmmapOutput = subprocess.Popen(['vmmap', '--summary', '{}'.format(proc.pid)], shell=False, stderr=subprocess.PIPE, stdout=subprocess.PIPE).stdout.read()
    215                 if sys.version_info[0] >= 3:
    216                     self.vmmapOutput = str(self.vmmapOutput, "utf-8")
     216                if self.vmmapOutput is not None:
     217                    self.vmmapOutput = subprocess.Popen(['vmmap', '--summary', '{}'.format(proc.pid)], shell=False, stderr=subprocess.PIPE, stdout=subprocess.PIPE).stdout.read()
     218                    if sys.version_info[0] >= 3:
     219                        self.vmmapOutput = str(self.vmmapOutput, "utf-8")
     220                if self.smapsOutput is not None:
     221                    self.smapsOutput = subprocess.Popen(['cat', '/proc/{}/smaps_rollup'.format(proc.pid)], shell=False, stderr=subprocess.PIPE, stdout=subprocess.PIPE).stdout.read()
    217222                proc.stdin.write(b"done\n")
    218223                proc.stdin.flush()
     
    236241    testRunner = args.runner(args)
    237242
    238 
    239     if args.takeVmmap:
     243    if args.takeVmmap or args.takeSmaps:
    240244        testRunner.setEnv("JS_SHELL_WAIT_FOR_INPUT_TO_EXIT", "1")
    241245
     
    271275                    if testResult.vmmapOutput:
    272276                        print(testResult.vmmapOutput)
     277                    if testResult.smapsOutput:
     278                        print(testResult.smapsOutput)
    273279                else:
    274280                    print
Note: See TracChangeset for help on using the changeset viewer.