Skip to content

Commit 154eed9

Browse files
committed
Migrate from deprecated CPUSampler#getData
1 parent 5001ff1 commit 154eed9

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/LsprofModuleBuiltins.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, 2023, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2020, 2024, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* The Universal Permissive License (UPL), Version 1.0
@@ -69,7 +69,6 @@
6969
import com.oracle.graal.python.runtime.object.PythonObjectSlowPathFactory;
7070
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
7171
import com.oracle.truffle.api.InstrumentInfo;
72-
import com.oracle.truffle.api.TruffleContext;
7372
import com.oracle.truffle.api.TruffleLanguage.Env;
7473
import com.oracle.truffle.api.dsl.GenerateNodeFactory;
7574
import com.oracle.truffle.api.dsl.NodeFactory;
@@ -282,9 +281,8 @@ abstract static class GetStats extends PythonBuiltinNode {
282281
static PList doit(Profiler self) {
283282
double avgSampleSeconds = self.sampler.getPeriod() / 1000D;
284283
List<PTuple> entries = new ArrayList<>();
285-
Map<TruffleContext, CPUSamplerData> data = self.sampler.getData();
286-
for (TruffleContext context : data.keySet()) {
287-
Map<Thread, Collection<ProfilerNode<Payload>>> threads = data.get(context).getThreadData();
284+
for (CPUSamplerData data : self.sampler.getDataList()) {
285+
Map<Thread, Collection<ProfilerNode<Payload>>> threads = data.getThreadData();
288286
for (Thread thread : threads.keySet()) {
289287
for (ProfilerNode<Payload> node : threads.get(thread)) {
290288
countNode(entries, node, avgSampleSeconds);

0 commit comments

Comments
 (0)