Skip to content

Commit

Permalink
Backport the logging profiler patch to .NET 6
Browse files Browse the repository at this point in the history
  • Loading branch information
iii-i committed Dec 11, 2023
1 parent a60ecf3 commit 4125b52
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
13 changes: 13 additions & 0 deletions dotnet-prepare
Original file line number Diff line number Diff line change
Expand Up @@ -65,28 +65,41 @@ git submodule update --init --recursive

pushd runtime
git fetch
# [custom_attrs] Use the image's ALC instead of the default one
# https://github.com/dotnet/runtime/pull/70346
backport "" 32670bdf9973
# Fix -cmakeargs option handling in build.sh
# https://github.com/dotnet/runtime/pull/70901
backport 643e9cf30c02 2a38e2093ab2
# [mono] Build mono logging profiler on s390x
# https://github.com/dotnet/runtime/pull/72049
backport 0e800a6139f1 eaf0bb292dfa
backport d2dff5d7e2d4 "../runtime-patches/Build-mono-logging-profiler-on-s390x.patch eaf0bb292dfa 0e800a6139f1"
# Add cmake check for ioclt prototype
# https://github.com/dotnet/runtime/pull/82173
backport f478cfe83eb5 4e0ff826321d
# Add stub for mini_is_gsharedvt_inst
# https://github.com/dotnet/runtime/pull/82678
backport "" 961418a93f7e
# [mono] Invoke AssemblyLoad hooks from RuntimeAssemblyBuilder:.ctor () instead from native code.
# https://github.com/dotnet/runtime/pull/85307
backport 93b487ad8075 5cea3d67b9b1
# fix runtime build failures on ppc64le
# https://github.com/dotnet/runtime/pull/88145
backport 910362b50c34 52bc96de5104
# [mono] Handle enum return type when inlining CreateInstance
# https://github.com/dotnet/runtime/pull/91008
backport cab57d89a5d7 "f51b3979f5f4 fe64d25f43e9"
# [mono] Fix GetCustomAttributes System.Reflection API with a custom attribute provider
# https://github.com/dotnet/runtime/pull/94602
backport "" 0cfad5669224
# [mono] [imt] Don't increment vt_slot for non-virtual generic methods
# https://github.com/dotnet/runtime/pull/94437
backport "" 0fb7b7dd0813
# Persist FPU variables across try_compile passes
# https://github.com/dotnet/runtime/pull/83206
backport 2f1694ea116c "../runtime-patches/Fix-cmakeargs-in-corehost-and-build-native-projs.patch c22b79ae2d1b 3c126e6e42b0"
# Make the cross-component build just another invocation of the build-runtime script
# https://github.com/dotnet/runtime/pull/67108
backport 51bf70e94b0c "../runtime-patches/Fix-cmakeargs-in-coreclr-proj.patch 7d562f9d2a42 2811e7c7551c"

Expand Down
32 changes: 32 additions & 0 deletions runtime-patches/Build-mono-logging-profiler-on-s390x.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
From 7a426c581f02c428f0dcc65b323e4ecfa7d40d56 Mon Sep 17 00:00:00 2001
From: Ilya Leoshkevich <[email protected]>
Date: Thu, 26 Jan 2023 00:38:15 +0100
Subject: [PATCH] [mono] Build mono logging profiler on s390x (#72049)

At the moment we don't have too many profiling options on s390x, and
the logging profiler comes in handy. Enable building it on s390x and
define MONO_DLL_EXPORT in order to unhide mono_profiler_init_log().
---
src/mono/mono/profiler/CMakeLists.txt | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/mono/mono/profiler/CMakeLists.txt b/src/mono/mono/profiler/CMakeLists.txt
index 784ceb0203d..de72e324b15 100644
--- a/src/mono/mono/profiler/CMakeLists.txt
+++ b/src/mono/mono/profiler/CMakeLists.txt
@@ -10,9 +10,10 @@ include_directories(
${PROJECT_SOURCE_DIR}/../sgen)

if(NOT DISABLE_LIBS)
- if(HOST_ANDROID OR HOST_IOS OR HOST_TVOS)
- # Build the logging profiler only for mobile platforms
+ if(HOST_ANDROID OR HOST_IOS OR HOST_TVOS OR HOST_S390X)
+ # Build the logging profiler only for certain platforms
add_library(mono-profiler-log SHARED helper.c log.c log-args.c)
+ target_compile_definitions(mono-profiler-log PRIVATE -DMONO_DLL_EXPORT)
target_link_libraries(mono-profiler-log monosgen-shared eglib_objects)
if(HOST_ANDROID)
target_link_libraries(mono-profiler-log log)
--
2.43.0

0 comments on commit 4125b52

Please sign in to comment.