Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Perfetto and fix tests #378

Merged
merged 50 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
83ec7a3
Modified submodules dyninst and timemory.
ajanicijamd Jul 29, 2024
b25741e
Modified PAPI submodule to fix GCC 13 build for Ubuntu 24.04.
ajanicijamd Jul 29, 2024
2959d00
Merge branch 'ROCm:main' into main
ajanicijamd Jul 29, 2024
209aa94
Updated PAPI submodule URL.
ajanicijamd Jul 29, 2024
bc1fad2
Fixed papi submodule URL.
ajanicijamd Jul 29, 2024
659104c
Merge branch 'ROCm:main' into main
ajanicijamd Jul 30, 2024
9a5a1e3
Using latest tag (papi-7-1-0-t) for papi submodule.
ajanicijamd Jul 30, 2024
e18cf6d
Update submodule dyninst to new version
ajanicijamd Jul 31, 2024
5094d4b
Added a mirror to elfutils
ajanicijamd Jul 31, 2024
f3cdbfa
Fixed compile with perfetto v46.0
ajanicijamd Aug 23, 2024
234c3fb
Fixed the Perfetto build
ajanicijamd Aug 27, 2024
837af7c
Merge branch 'ROCm:main' into SWDEV-479652-perfetto-based-tests-are-f…
ajanicijamd Aug 27, 2024
5f55b23
Updated Perfetto to v46.0
ajanicijamd Aug 27, 2024
c49f41a
Merge branch 'SWDEV-479652-perfetto-based-tests-are-failing'
ajanicijamd Aug 27, 2024
d0e2793
Updated version of Perfetto to v46.0 in Packages.cmake
ajanicijamd Aug 27, 2024
f300b80
Fixed Perfetto trace processor tests
ajanicijamd Sep 6, 2024
3ff3568
Merge branch 'ROCm:main' into SWDEV-479652-perfetto
ajanicijamd Sep 6, 2024
40bc184
Fixed formatting of Python script
ajanicijamd Sep 6, 2024
69905a1
Fixed formatting of CMake listfiles
ajanicijamd Sep 6, 2024
42ffe97
Fixed formatting of CMake listfiles
ajanicijamd Sep 6, 2024
a82f8ac
Fixed formatting of C++ code
ajanicijamd Sep 6, 2024
31b17c9
Fixed formatting of C++ code
ajanicijamd Sep 6, 2024
8143d39
Fixed formatting of C++ code
ajanicijamd Sep 6, 2024
ae7ee01
Modified path to trace_processor_shell
ajanicijamd Sep 6, 2024
d710cfd
Fixed formatting
ajanicijamd Sep 6, 2024
d667d88
Fixed formatting
ajanicijamd Sep 6, 2024
66c2ccc
Test workflow update
dgaliffiAMD Sep 6, 2024
e85ccc8
Update redhat.yml
dgaliffiAMD Sep 8, 2024
c8348fd
Update opensuse.yml
dgaliffiAMD Sep 8, 2024
891a199
Update dockerfiles
dgaliffiAMD Sep 8, 2024
eeacde2
Update Workflows
dgaliffiAMD Sep 8, 2024
988456a
Add -Wno-mismatched-new-delete to Perfetto cmake
dgaliffiAMD Sep 8, 2024
6f9629f
Fix C Flags
dgaliffiAMD Sep 8, 2024
678316e
Fix the OpenSuse workflow
dgaliffiAMD Sep 8, 2024
57c30e2
Update Ubuntu Focal workflow
dgaliffiAMD Sep 8, 2024
e41f50f
Revert "Update dockerfiles"
dgaliffiAMD Sep 9, 2024
0bb9b0d
Update ubuntu workflows
dgaliffiAMD Sep 9, 2024
3fa63d6
Add error checking to script
dgaliffiAMD Sep 9, 2024
92dbecb
Update Perfetto module to v47.0 and use GitHub URL
dgaliffiAMD Sep 9, 2024
bd3ea2c
Disable verbose logs
dgaliffiAMD Sep 9, 2024
e68c926
Disable INSTALL_PERFETTO_TOOLS option
dgaliffiAMD Sep 9, 2024
c30fdac
Install trace_processor_shell as a part of setup
dgaliffiAMD Sep 9, 2024
15cd0d2
Fix download path of trace_processor_shell
dgaliffiAMD Sep 9, 2024
a598b84
Revert "Update Perfetto module to v47.0 and use GitHub URL"
dgaliffiAMD Sep 10, 2024
750e5f8
Add `trace_processor_shell` install to Ubuntu-Focal workflow
dgaliffiAMD Sep 10, 2024
cf41035
Remove the pip update of protobuf
dgaliffiAMD Sep 10, 2024
5513f6e
Remove upgrading pip modules in workflows
dgaliffiAMD Sep 12, 2024
aa59a01
Modified script used for Python testing so it doesn't use numpy
ajanicijamd Sep 12, 2024
f066074
Fixed Python formatting
ajanicijamd Sep 13, 2024
86b57b0
Fixed Python scripts so they don't refer to a specific Python executable
ajanicijamd Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Packages.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ omnitrace_checkout_git_submodule(
RELATIVE_PATH external/perfetto
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
REPO_URL https://android.googlesource.com/platform/external/perfetto
REPO_BRANCH v28.0
REPO_BRANCH v46.0
TEST_FILE sdk/perfetto.cc)

include(Perfetto)
Expand Down
4 changes: 2 additions & 2 deletions cmake/Perfetto.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ if(CMAKE_CXX_COMPILER_IS_CLANG)
else()
set(PERFETTO_IS_CLANG false)
set(OMNITRACE_PERFETTO_C_FLAGS
"-static-libgcc -Wno-maybe-uninitialized"
"-static-libgcc -Wno-maybe-uninitialized -Wno-stringop-overflow"
CACHE STRING "Perfetto C flags")
set(OMNITRACE_PERFETTO_CXX_FLAGS
"-static-libgcc -Wno-maybe-uninitialized"
"-static-libgcc -Wno-maybe-uninitialized -Wno-stringop-overflow"
CACHE STRING "Perfetto C++ flags")
endif()

Expand Down
8 changes: 4 additions & 4 deletions cmake/Templates/args.gn.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ is_clang = @PERFETTO_IS_CLANG@
is_hermetic_clang = false

enable_perfetto_benchmarks = false
enable_perfetto_integration_tests = false
enable_perfetto_integration_tests = true
enable_perfetto_unittests = false
enable_perfetto_fuzzers = false

# enable_perfetto_stderr_crash_dump = false
enable_perfetto_heapprofd = false
enable_perfetto_tools = false
enable_perfetto_trace_processor = false
enable_perfetto_trace_processor_httpd = false
enable_perfetto_trace_processor = true
enable_perfetto_trace_processor_httpd = true
enable_perfetto_trace_processor_json = false
enable_perfetto_trace_processor_linenoise = false
enable_perfetto_trace_processor_percentile = false
enable_perfetto_trace_processor_sqlite = false
enable_perfetto_trace_processor_sqlite = true
enable_perfetto_ui = false

extra_cflags = "@OMNITRACE_PERFETTO_C_FLAGS@"
Expand Down
2 changes: 1 addition & 1 deletion external/perfetto
Submodule perfetto updated from 99ead4 to 35b3d9
11 changes: 6 additions & 5 deletions source/lib/core/perfetto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@ perfetto_counter_track<Tp>::emplace(size_t _idx, const std::string& _v,
auto _index = _track_data.size();
auto& _name = _name_data.emplace_back(std::make_unique<std::string>(_v));
const char* _unit_name = (_units && strlen(_units) > 0) ? _units : nullptr;
_track_data.emplace_back(::perfetto::CounterTrack{ _name->c_str() }
.set_unit_name(_unit_name)
.set_category(_category)
.set_unit_multiplier(_mult)
.set_is_incremental(_incr));
_track_data.emplace_back(
::perfetto::CounterTrack{ ::perfetto::DynamicString{ _name->c_str() } }
.set_unit_name(_unit_name)
.set_category(_category)
.set_unit_multiplier(_mult)
.set_is_incremental(_incr));
if(config::get_is_continuous_integration())
{
for(auto& itr : _missing)
Expand Down
6 changes: 3 additions & 3 deletions source/lib/omnitrace/library/tracing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,14 +642,14 @@ mark_perfetto_ts(CategoryT, const char* name, uint64_t _ts, Args&&... args)

template <typename CategoryT, typename... Args>
inline void
mark_perfetto_track(CategoryT, const char*, ::perfetto::Track _track, uint64_t _ts,
mark_perfetto_track(CategoryT, const char* name, ::perfetto::Track _track, uint64_t _ts,
Args&&... args)
{
// skip if category is disabled
if(category_mark_disabled<CategoryT>()) return;

TRACE_EVENT_INSTANT(trait::name<CategoryT>::value, _track, _ts,
std::forward<Args>(args)...);
TRACE_EVENT_INSTANT(trait::name<CategoryT>::value, ::perfetto::DynamicString{ name },
_track, _ts, std::forward<Args>(args)...);
}
} // namespace tracing
} // namespace omnitrace
3 changes: 2 additions & 1 deletion tests/omnitrace-python-tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ foreach(_VERSION ${OMNITRACE_PYTHON_VERSIONS})
NAME ${TEST_NAME}-validate-perfetto
COMMAND
${_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_LIST_DIR}/validate-perfetto-proto.py
-m ${TEST_PERFETTO_METRIC} ${TEST_ARGS} -p -i
-m ${TEST_PERFETTO_METRIC} ${TEST_ARGS} -p -t
${OMNITRACE_PERFETTO_BINARY_DIR}/trace_processor_shell -i
PYTHON_VERSION ${_VERSION}
FILE omnitrace-tests-output/${TEST_NAME}/${_VERSION}/${TEST_PERFETTO_FILE}
DEPENDS ${TEST_NAME}-${_VERSION}
Expand Down
1 change: 1 addition & 0 deletions tests/omnitrace-testing.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -985,6 +985,7 @@ function(OMNITRACE_ADD_VALIDATION_TEST)
${CMAKE_CURRENT_LIST_DIR}/validate-perfetto-proto.py -m
"${TEST_PERFETTO_METRIC}" ${TEST_ARGS} -i
${PROJECT_BINARY_DIR}/omnitrace-tests-output/${TEST_NAME}/${TEST_PERFETTO_FILE}
-t ${OMNITRACE_PERFETTO_BINARY_DIR}/trace_processor_shell
WORKING_DIRECTORY ${PROJECT_BINARY_DIR})
endif()

Expand Down
15 changes: 11 additions & 4 deletions tests/validate-perfetto-proto.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,22 @@

import sys
dgaliffiAMD marked this conversation as resolved.
Show resolved Hide resolved
import argparse
from perfetto.trace_processor import TraceProcessor
from perfetto.trace_processor import TraceProcessor, TraceProcessorConfig


def load_trace(inp, max_tries=5, retry_wait=1):
def load_trace(inp, max_tries=5, retry_wait=1, bin_path=None):
"""Occasionally connecting to the trace processor fails with HTTP errors
so this function tries to reduce spurious test failures"""

dgaliffiAMD marked this conversation as resolved.
Show resolved Hide resolved
n = 0
tp = None
while tp is None:
try:
tp = TraceProcessor(trace=(inp))
if bin_path:
config = TraceProcessorConfig(bin_path=bin_path)
tp = TraceProcessor(trace=(inp), config=config)
else:
tp = TraceProcessor(trace=(inp))
break
except Exception as e:
sys.stderr.write(f"{e}\n")
Expand Down Expand Up @@ -71,6 +75,9 @@ def validate_perfetto(data, labels, counts, depths):
"-p", "--print", action="store_true", help="Print the processed perfetto data"
)
parser.add_argument("-i", "--input", type=str, help="Input file", required=True)
parser.add_argument(
"-t", "--trace_processor_shell", type=str, help="Path of trace_processor_shell"
)
parser.add_argument(
"--key-names",
type=str,
Expand All @@ -93,7 +100,7 @@ def validate_perfetto(data, labels, counts, depths):
"The same number of labels, counts, and depths must be specified"
)

tp = load_trace(args.input)
tp = load_trace(args.input, bin_path=args.trace_processor_shell)

if tp is None:
raise ValueError(f"trace {args.input} could not be loaded")
Expand Down
Loading