From c7a37b113d0e1f5c518c0ebc807cbb78e5676bf5 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Fri, 28 Sep 2018 20:40:38 +0900 Subject: [PATCH 01/13] installation for Amazon Linux 2 --- src/performance/perfcollect/perfcollect | 102 ++++++++++++++++++++++-- 1 file changed, 94 insertions(+), 8 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index ffed618..e9fd28d 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -792,6 +792,29 @@ GetCommandFullPath() ###################################### # Prerequisite Installation ###################################### +IsAmazonLinux() +{ + local al2=0 + if[ -f /etc/system-release ] + then + local amz=`cat /etc/system-release | grep Amazon` + if [ "$amz" == "Amazon Linux 2" ] + then + al2=1 + fi + fi + echo $al2 +} + +InstallPerf_AL2() +{ + # Disallow non-root users. + EnsureRoot + + # Install perf + yum install perf zip unzip +} + IsRHEL() { local rhel=0 @@ -897,11 +920,70 @@ InstallPerf() elif [ "$(IsRHEL)" == "1" ] then InstallPerf_RHEL + elif [ "$(IsAmazonLinux)" == "1" ] + then + InstallPerf_AL2 else FatalError "Auto install unsupported for this distribution. Install perf manually to continue." fi } +InstallLTTng_AL2() +{ + # Disallow non-root users. + EnsureRoot + + packageRepo="https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo" + + # Prompt for confirmation, since we need to add a new repository. + BlueText + echo "LTTng installation requires that a new package repo be added to your yum configuration." + echo "The package repo url is: $packageRepo" + echo "" + read -p "Would you like to add the LTTng package repo to your YUM configuration? [Y/N]" resp + ResetText + if [ "$resp" == "Y" ] || [ "$resp" == "y" ] + then + # Make sure that wget is installed. + BlueText + echo "Installing wget. Required to add package repo." + ResetText + yum install wget + + # Connect to the LTTng package repo. + wget -P /etc/yum.repos.d/ $packageRepo + + # Import package signing key. + rpmkeys --import https://packages.efficios.com/rhel/repo.key + + # Update the yum package database. + yum updateinfo + + # Install kernel + yum install kernel-devel-$(uname -r) + + # Generate signing key + openssl req -new -x509 -newkey rsa:2048 -keyout /usr/src/kernels/$(uname -r)/certs/signing_key.pem -outform DER -out /usr/src/kernels/$(uname -r)/certs/signing_key.x509 -nodes -subj "/CN=Owner/" + + # Clean up old kernel + rpm -q kernel + package-cleanup --oldkernels --count=1 + + # Install LTTng + yum install lttng-tools lttng-ust babeltrace + + cd $(mktemp -d) && + wget http://lttng.org/files/lttng-modules/lttng-modules-latest-2.10.tar.bz2 && + tar -xf lttng-modules-latest-2.10.tar.bz2 && + cd lttng-modules-2.10.* && + make && + sudo make modules_install && + sudo depmod -a + + # yum install kmod-lttng-modules + fi +} + InstallLTTng_RHEL() { # Disallow non-root users. @@ -1027,6 +1109,9 @@ InstallLTTng() elif [ "$(IsRHEL)" == "1" ] then InstallLTTng_RHEL + elif [ "$(IsAmazonLinux)" == "1" ] + then + InstallLTTng_AL2 else FatalError "Auto install unsupported for this distribution. Install lttng and lttng-ust packages manually." fi @@ -1233,13 +1318,14 @@ ProcessArguments() ## lttngSessionName='' lttngTraceDir='' +output='' CreateLTTngSession() { if [ "$action" == "livetrace" ] then - output=`lttng create --live` + output=`$lttngcmd create --live` else - output=`lttng create` + output=`$lttngcmd create` fi lttngSessionName=`echo $output | grep -o "Session.*created." | sed 's/\(Session \| created.\)//g'` @@ -1249,9 +1335,9 @@ CreateLTTngSession() SetupLTTngSession() { # Setup per-event context information. - RunSilent "lttng add-context --userspace --type vpid" - RunSilent "lttng add-context --userspace --type vtid" - RunSilent "lttng add-context --userspace --type procname" + RunSilent "$lttngcmd add-context --userspace --type vpid" + RunSilent "$lttngcmd add-context --userspace --type vtid" + RunSilent "$lttngcmd add-context --userspace --type procname" if [ "$action" == "livetrace" ] then @@ -1296,7 +1382,7 @@ SetupLTTngSession() DestroyLTTngSession() { - RunSilent "lttng destroy $lttngSessionName" + RunSilent "$lttngcmd destroy $lttngSessionName" } StartLTTngCollection() @@ -1304,12 +1390,12 @@ StartLTTngCollection() CreateLTTngSession SetupLTTngSession - RunSilent "lttng start $lttngSessionName" + RunSilent "$lttngcmd start $lttngSessionName" } StopLTTngCollection() { - RunSilent "lttng stop $lttngSessionName" + RunSilent "$lttngcmd stop $lttngSessionName" DestroyLTTngSession } From 1cd90c010486f1fec5eb89ab8a9f05a16dd36cf7 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Tue, 2 Oct 2018 11:15:54 +0900 Subject: [PATCH 02/13] [add] liburcu install [fix] workaround to solve Amazon Linux 2 duplicate kernel issue --- src/performance/perfcollect/perfcollect | 27 ++++++++++++++----------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index e9fd28d..cd5684c 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -795,7 +795,7 @@ GetCommandFullPath() IsAmazonLinux() { local al2=0 - if[ -f /etc/system-release ] + if [ -f /etc/system-release ] then local amz=`cat /etc/system-release | grep Amazon` if [ "$amz" == "Amazon Linux 2" ] @@ -965,22 +965,25 @@ InstallLTTng_AL2() # Generate signing key openssl req -new -x509 -newkey rsa:2048 -keyout /usr/src/kernels/$(uname -r)/certs/signing_key.pem -outform DER -out /usr/src/kernels/$(uname -r)/certs/signing_key.x509 -nodes -subj "/CN=Owner/" - # Clean up old kernel + # Query to check installed kernels on this machine rpm -q kernel - package-cleanup --oldkernels --count=1 + # Clean up old kernel (AL2 had duplicated kernel issue, uncomment next two commands if error happened) + # package-cleanup --oldkernels --count=1 + # $ sudo mv /usr/src/kernels/$(uname -r)/include/linux/version.h /usr/src/kernels/$(uname -r)/include/linux/version.h.bak - # Install LTTng - yum install lttng-tools lttng-ust babeltrace - + # AL2 pre required as follow libraries: libuuid, popt, libxml2 and Userspace RCU (only liburcu is not available on AL2) cd $(mktemp -d) && - wget http://lttng.org/files/lttng-modules/lttng-modules-latest-2.10.tar.bz2 && - tar -xf lttng-modules-latest-2.10.tar.bz2 && - cd lttng-modules-2.10.* && + wget https://lttng.org/files/urcu/userspace-rcu-latest-0.10.tar.bz2 && + tar -xf userspace-rcu-latest-0.10.tar.bz2 && + cd userspace-rcu-0.10.* && + ./configure && make && - sudo make modules_install && - sudo depmod -a + sudo make install && + sudo ldconfig + export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - # yum install kmod-lttng-modules + # Install LTTng + yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace fi } From 6df4e80e82eb6dd662bdf540af6359f4b86b9105 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Wed, 3 Oct 2018 18:47:29 +0900 Subject: [PATCH 03/13] Build lttng from source (url: https://lttng.org/files/ ) --- src/performance/perfcollect/perfcollect | 66 +++++++++++++++++++++---- 1 file changed, 57 insertions(+), 9 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index cd5684c..7fda302 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -948,19 +948,19 @@ InstallLTTng_AL2() BlueText echo "Installing wget. Required to add package repo." ResetText - yum install wget + yum -y install wget # Connect to the LTTng package repo. - wget -P /etc/yum.repos.d/ $packageRepo + #wget -P /etc/yum.repos.d/ $packageRepo # Import package signing key. - rpmkeys --import https://packages.efficios.com/rhel/repo.key + #rpmkeys --import https://packages.efficios.com/rhel/repo.key # Update the yum package database. yum updateinfo # Install kernel - yum install kernel-devel-$(uname -r) + #yum install kernel-devel-$(uname -r) # Generate signing key openssl req -new -x509 -newkey rsa:2048 -keyout /usr/src/kernels/$(uname -r)/certs/signing_key.pem -outform DER -out /usr/src/kernels/$(uname -r)/certs/signing_key.x509 -nodes -subj "/CN=Owner/" @@ -969,10 +969,31 @@ InstallLTTng_AL2() rpm -q kernel # Clean up old kernel (AL2 had duplicated kernel issue, uncomment next two commands if error happened) # package-cleanup --oldkernels --count=1 - # $ sudo mv /usr/src/kernels/$(uname -r)/include/linux/version.h /usr/src/kernels/$(uname -r)/include/linux/version.h.bak + # mv /usr/src/kernels/$(uname -r)/include/linux/version.h /usr/src/kernels/$(uname -r)/include/linux/version.h.bak + + # Install LTTng + #yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace + + ## Build from source - # AL2 pre required as follow libraries: libuuid, popt, libxml2 and Userspace RCU (only liburcu is not available on AL2) - cd $(mktemp -d) && + # Store tarball source + mkdir /usr/src/lttng.org && + cd /usr/src/lttng.org + + # LTTng pre required as follow libraries: libuuid, popt, libxml2 and Userspace RCU + # Install libuuid + yum -y install libuuid.x86_64 libuuid-devel.x86_64 + + # popt + wget http://rpm5.org/files/popt/popt-1.16.tar.gz && + tar -xf popt-1.16.tar.gz && + cd popt-1.16 && + ./configure && + make && + sudo make install && + ldconfig + + # Userspace-rcu wget https://lttng.org/files/urcu/userspace-rcu-latest-0.10.tar.bz2 && tar -xf userspace-rcu-latest-0.10.tar.bz2 && cd userspace-rcu-0.10.* && @@ -982,8 +1003,35 @@ InstallLTTng_AL2() sudo ldconfig export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig - # Install LTTng - yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace + # libxml2 + yum -y install libxml2.x86_64 libxml2-devel.x86_64 + + # LTTng-UST + wget http://lttng.org/files/lttng-ust/lttng-ust-latest-2.10.tar.bz2 && + tar -xf lttng-ust-latest-2.10.tar.bz2 && + cd lttng-ust-2.10.* && + ./configure && + make && + sudo make install && + sudo ldconfig + + # LTTng-Tools + wget http://lttng.org/files/lttng-tools/lttng-tools-latest-2.10.tar.bz2 && + tar -xf lttng-tools-latest-2.10.tar.bz2 && + cd lttng-tools-2.10.* && + ./configure && + make && + sudo make install && + sudo ldconfig + + # Babeltrace + wget https://lttng.org/files/babeltrace/babeltrace-latest-1.2.tar.bz2 && + tar -xf babeltrace-latest-1.2.tar.bz2 && + cd babeltrace-1.2.* && + ./configure && + make && + sudo make install + fi } From 36bf3159590ad6c4d39691e0ba8cb7e623d677ee Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Thu, 4 Oct 2018 10:18:58 +0900 Subject: [PATCH 04/13] replaced babeltrace package set lttng command path --- src/performance/perfcollect/perfcollect | 33 ++++++++++++++----------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index 7fda302..397c919 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -666,7 +666,7 @@ InitializeLog() # The system information. LogAppend 'Machine info: ' `uname -a` LogAppend 'perf version:' `$perfcmd --version` - LogAppend 'LTTng version: ' `lttng --version` + LogAppend 'LTTng version: ' `$lttngcmd --version` LogAppend } @@ -779,7 +779,7 @@ DiscoverCommands() fi fi fi - lttngcmd=`GetCommandFullPath "lttng"` + lttngcmd="/usr/local/bin/lttng" # Not work on AL2 `GetCommandFullPath "lttng"` zipcmd=`GetCommandFullPath "zip"` unzipcmd=`GetCommandFullPath "unzip"` } @@ -977,14 +977,14 @@ InstallLTTng_AL2() ## Build from source # Store tarball source - mkdir /usr/src/lttng.org && - cd /usr/src/lttng.org + mkdir /usr/src/lttng.org && # LTTng pre required as follow libraries: libuuid, popt, libxml2 and Userspace RCU # Install libuuid yum -y install libuuid.x86_64 libuuid-devel.x86_64 # popt + cd /usr/src/lttng.org wget http://rpm5.org/files/popt/popt-1.16.tar.gz && tar -xf popt-1.16.tar.gz && cd popt-1.16 && @@ -993,7 +993,8 @@ InstallLTTng_AL2() sudo make install && ldconfig - # Userspace-rcu + # Userspace-rcu + cd /usr/src/lttng.org wget https://lttng.org/files/urcu/userspace-rcu-latest-0.10.tar.bz2 && tar -xf userspace-rcu-latest-0.10.tar.bz2 && cd userspace-rcu-0.10.* && @@ -1006,7 +1007,8 @@ InstallLTTng_AL2() # libxml2 yum -y install libxml2.x86_64 libxml2-devel.x86_64 - # LTTng-UST + # LTTng-UST + cd /usr/src/lttng.org wget http://lttng.org/files/lttng-ust/lttng-ust-latest-2.10.tar.bz2 && tar -xf lttng-ust-latest-2.10.tar.bz2 && cd lttng-ust-2.10.* && @@ -1016,6 +1018,7 @@ InstallLTTng_AL2() sudo ldconfig # LTTng-Tools + cd /usr/src/lttng.org wget http://lttng.org/files/lttng-tools/lttng-tools-latest-2.10.tar.bz2 && tar -xf lttng-tools-latest-2.10.tar.bz2 && cd lttng-tools-2.10.* && @@ -1025,12 +1028,14 @@ InstallLTTng_AL2() sudo ldconfig # Babeltrace - wget https://lttng.org/files/babeltrace/babeltrace-latest-1.2.tar.bz2 && - tar -xf babeltrace-latest-1.2.tar.bz2 && - cd babeltrace-1.2.* && - ./configure && - make && - sudo make install + yum -y install babeltrace + #cd /usr/src/lttng.org + #wget https://lttng.org/files/babeltrace/babeltrace-latest-1.2.tar.bz2 && + #tar -xf babeltrace-latest-1.2.tar.bz2 && + #cd babeltrace-1.2.* && + #./configure && + #make && + #sudo make install fi } @@ -1392,7 +1397,7 @@ SetupLTTngSession() if [ "$action" == "livetrace" ] then - RunSilent "lttng enable-event --userspace --tracepoint DotNETRuntime:EventSource" + RunSilent "$lttngcmd enable-event --userspace --tracepoint DotNETRuntime:EventSource" elif [ "$gcCollectOnly" == "1" ] then usePerf=0 @@ -1457,7 +1462,7 @@ EnableLTTngEvents() args=( "$@" ) for (( i=0; i<${#args[@]}; i++ )) do - RunSilent "lttng enable-event -s $lttngSessionName -u --tracepoint ${args[$i]}" + RunSilent "$lttngcmd enable-event -s $lttngSessionName -u --tracepoint ${args[$i]}" done } From 6c77a5c24e3157b6453f5829596988083732beb6 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Thu, 4 Oct 2018 10:24:22 +0900 Subject: [PATCH 05/13] echo build source url --- src/performance/perfcollect/perfcollect | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index 397c919..6144b56 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -933,7 +933,8 @@ InstallLTTng_AL2() # Disallow non-root users. EnsureRoot - packageRepo="https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo" + # packageRepo="https://packages.efficios.com/repo.files/EfficiOS-RHEL7-x86-64.repo" + packageRepo="https://lttng.org/files" # Prompt for confirmation, since we need to add a new repository. BlueText @@ -950,6 +951,7 @@ InstallLTTng_AL2() ResetText yum -y install wget + ### Build via epel packages ### # Connect to the LTTng package repo. #wget -P /etc/yum.repos.d/ $packageRepo @@ -974,7 +976,7 @@ InstallLTTng_AL2() # Install LTTng #yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace - ## Build from source + ### Build from source ### # Store tarball source mkdir /usr/src/lttng.org && From b88aee7889f260827e41168bc36740f64a6dee3a Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Thu, 4 Oct 2018 11:16:38 +0900 Subject: [PATCH 06/13] Added guide --- src/performance/perfcollect/Readme.md | 52 +++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 src/performance/perfcollect/Readme.md diff --git a/src/performance/perfcollect/Readme.md b/src/performance/perfcollect/Readme.md new file mode 100644 index 0000000..8f99e4d --- /dev/null +++ b/src/performance/perfcollect/Readme.md @@ -0,0 +1,52 @@ +### Linux Performance Tracing for dotnet core on Linux. + (※) This forced version support Amazon Linux 2 + + You need read this guideline at first. + https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/linux-performance-tracing.md + + +### Install + $sudo ./perfcollect install + +### Run + + Collect data from the specified pid +```bash + $sudo ./perfcollect collect -pid ??? +``` + + Collect context switch events +```bash + $sudo ./perfcollect collect -threadtime +``` + +### View result + lttng view + ```bash + $sudo ./perfcollect view testtrace.trace.zip --viewer=lttng +``` + + perf view +```bash + $sudo ./perfcollect view testtrace.trace.zip --viewer=perf # default view +``` + +### Notes: + * Enables tracing configuration inside of CoreCLR. Run it before collect data +``` bash + export COMPlus_PerfMapEnabled=1 + export COMPlus_EnableEventLog=1 +``` + + * Solving error of "Crossgen not found. Framework symbols will be unavailable." + Follow [this guide](https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/linux-performance-tracing.md#resolving-framework-symbols) for detail. + + Download the CoreCLR nuget package. +``` bash + dotnet publish --self-contained -r linux-x64 +``` + + Copy crossgen next to libcoreclr.so +``` bash + sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app/2.1.2/tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.2/ +``` From 6e944ac5ff01beef055627779320233a52483c57 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Thu, 4 Oct 2018 15:37:24 +0900 Subject: [PATCH 07/13] enabled "Amazon Extras repo for epel" because of glib2 error --- src/performance/perfcollect/perfcollect | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index 6144b56..d85d192 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -951,6 +951,10 @@ InstallLTTng_AL2() ResetText yum -y install wget + # Install build package + sudo yum -y install gcc gcc-c++ glib2 glibc make zlib-devel + sudo amazon-linux-extras install epel + ### Build via epel packages ### # Connect to the LTTng package repo. #wget -P /etc/yum.repos.d/ $packageRepo @@ -1030,7 +1034,7 @@ InstallLTTng_AL2() sudo ldconfig # Babeltrace - yum -y install babeltrace + yum -y install babeltrace # need enable epel: $sudo amazon-linux-extras install epel #cd /usr/src/lttng.org #wget https://lttng.org/files/babeltrace/babeltrace-latest-1.2.tar.bz2 && #tar -xf babeltrace-latest-1.2.tar.bz2 && From 7bb32c81ef5efca2a92adb3b5e3ebb0104eefc75 Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Thu, 4 Oct 2018 15:41:55 +0900 Subject: [PATCH 08/13] generate crossgen file --- src/performance/perfcollect/Readme.md | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/performance/perfcollect/Readme.md b/src/performance/perfcollect/Readme.md index 8f99e4d..5099213 100644 --- a/src/performance/perfcollect/Readme.md +++ b/src/performance/perfcollect/Readme.md @@ -48,5 +48,16 @@ Copy crossgen next to libcoreclr.so ``` bash - sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app/2.1.2/tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App/2.1.2/ + sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app//tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App// ``` + + * For running application, you need new dotnet project then copy crossgen file +```bash + mkdir /tmp/dotnetsample + cd /tmp/dotnetsample + dotnet new webapi + dotnet restore + dotnet publish --self-contained -r linux-x64 + + sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app//tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App// +``` \ No newline at end of file From 9a92bb16fae2fd62fb2070d3d4daaef3d414d927 Mon Sep 17 00:00:00 2001 From: "Le Ba Thanh (gloops Inc.,)" Date: Thu, 4 Oct 2018 16:01:18 +0900 Subject: [PATCH 09/13] Update Readme.md Updated Readme --- src/performance/perfcollect/Readme.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/performance/perfcollect/Readme.md b/src/performance/perfcollect/Readme.md index 5099213..9e685ff 100644 --- a/src/performance/perfcollect/Readme.md +++ b/src/performance/perfcollect/Readme.md @@ -5,6 +5,10 @@ https://github.com/dotnet/coreclr/blob/master/Documentation/project-docs/linux-performance-tracing.md +### Download shell script + $curl -OL https://raw.githubusercontent.com/lbthanh/corefx-tools/master/src/performance/perfcollect/perfcollect + $chmod +x perfcollect + ### Install $sudo ./perfcollect install @@ -51,7 +55,7 @@ sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app//tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App// ``` - * For running application, you need new dotnet project then copy crossgen file +* For running application, you need new dotnet project then copy crossgen file ```bash mkdir /tmp/dotnetsample cd /tmp/dotnetsample @@ -60,4 +64,4 @@ dotnet publish --self-contained -r linux-x64 sudo cp ~/.nuget/packages/runtime.linux-x64.microsoft.netcore.app//tools/crossgen /usr/share/dotnet/shared/Microsoft.NETCore.App// -``` \ No newline at end of file +``` From 4e86d4cab79d60f49c4984762543929302a5c890 Mon Sep 17 00:00:00 2001 From: "Le Ba Thanh (gloops Inc.,)" Date: Thu, 4 Oct 2018 16:02:02 +0900 Subject: [PATCH 10/13] Updated Readme --- src/performance/perfcollect/Readme.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/performance/perfcollect/Readme.md b/src/performance/perfcollect/Readme.md index 9e685ff..37c735e 100644 --- a/src/performance/perfcollect/Readme.md +++ b/src/performance/perfcollect/Readme.md @@ -6,8 +6,10 @@ ### Download shell script +```bash $curl -OL https://raw.githubusercontent.com/lbthanh/corefx-tools/master/src/performance/perfcollect/perfcollect $chmod +x perfcollect +``` ### Install $sudo ./perfcollect install From abadb6e6b06c47885a1eff356b9194ba32fb251e Mon Sep 17 00:00:00 2001 From: Le Ba Thanh Date: Fri, 5 Oct 2018 16:14:46 +0900 Subject: [PATCH 11/13] don't need signing when current kernel 4.14.70-72.55.amzn2.x86_64 --- src/performance/perfcollect/perfcollect | 30 ++++++++++++------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index d85d192..1fefb32 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -951,25 +951,29 @@ InstallLTTng_AL2() ResetText yum -y install wget - # Install build package - sudo yum -y install gcc gcc-c++ glib2 glibc make zlib-devel - sudo amazon-linux-extras install epel - ### Build via epel packages ### # Connect to the LTTng package repo. #wget -P /etc/yum.repos.d/ $packageRepo + # Update packages + #yum updateinfo + # Import package signing key. #rpmkeys --import https://packages.efficios.com/rhel/repo.key + + # Install LTTng + #yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace - # Update the yum package database. - yum updateinfo - + ### Build from source ### + # Install build package + #sudo yum -y install gcc gcc-c++ glib2 glibc make zlib-devel # Install kernel - #yum install kernel-devel-$(uname -r) + yum install kernel-devel-$(uname -r) + # Enable Extra Packages for Enterprise Linux 7 - x86_64 + sudo amazon-linux-extras install epel - # Generate signing key - openssl req -new -x509 -newkey rsa:2048 -keyout /usr/src/kernels/$(uname -r)/certs/signing_key.pem -outform DER -out /usr/src/kernels/$(uname -r)/certs/signing_key.x509 -nodes -subj "/CN=Owner/" + # Generate signing key (need it if older kernel version: 4.14.70-72.55.amzn2.x86_64) + # openssl req -new -x509 -newkey rsa:2048 -keyout /usr/src/kernels/$(uname -r)/certs/signing_key.pem -outform DER -out /usr/src/kernels/$(uname -r)/certs/signing_key.x509 -nodes -subj "/CN=Owner/" # Query to check installed kernels on this machine rpm -q kernel @@ -977,11 +981,6 @@ InstallLTTng_AL2() # package-cleanup --oldkernels --count=1 # mv /usr/src/kernels/$(uname -r)/include/linux/version.h /usr/src/kernels/$(uname -r)/include/linux/version.h.bak - # Install LTTng - #yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace - - ### Build from source ### - # Store tarball source mkdir /usr/src/lttng.org && @@ -1035,6 +1034,7 @@ InstallLTTng_AL2() # Babeltrace yum -y install babeltrace # need enable epel: $sudo amazon-linux-extras install epel + #cd /usr/src/lttng.org #wget https://lttng.org/files/babeltrace/babeltrace-latest-1.2.tar.bz2 && #tar -xf babeltrace-latest-1.2.tar.bz2 && From 70bb99c5e99df99c19ddf5f823d13a071c48e145 Mon Sep 17 00:00:00 2001 From: "Le Ba Thanh (gloops Inc.,)" Date: Wed, 8 May 2019 17:35:37 +0900 Subject: [PATCH 12/13] Amazon Linux 2 release --- src/performance/perfcollect/perfcollect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index 1fefb32..14dbb69 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -794,13 +794,13 @@ GetCommandFullPath() ###################################### IsAmazonLinux() { - local al2=0 + local al2=1 if [ -f /etc/system-release ] then local amz=`cat /etc/system-release | grep Amazon` - if [ "$amz" == "Amazon Linux 2" ] + if [ -z "$amz" ] then - al2=1 + al2=0 fi fi echo $al2 From dd3a7dafbc67c4ccde1ec02372f0d0a05c75cacb Mon Sep 17 00:00:00 2001 From: "Le Ba Thanh (gloops Inc.,)" Date: Thu, 9 May 2019 13:02:09 +0900 Subject: [PATCH 13/13] Force yum install --- src/performance/perfcollect/perfcollect | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/performance/perfcollect/perfcollect b/src/performance/perfcollect/perfcollect index 14dbb69..74e108c 100755 --- a/src/performance/perfcollect/perfcollect +++ b/src/performance/perfcollect/perfcollect @@ -812,7 +812,7 @@ InstallPerf_AL2() EnsureRoot # Install perf - yum install perf zip unzip + yum -y install perf zip unzip } IsRHEL() @@ -962,13 +962,13 @@ InstallLTTng_AL2() #rpmkeys --import https://packages.efficios.com/rhel/repo.key # Install LTTng - #yum install lttng-tools lttng-ust kmod-lttng-modules babeltrace + #yum -y install lttng-tools lttng-ust kmod-lttng-modules babeltrace ### Build from source ### # Install build package #sudo yum -y install gcc gcc-c++ glib2 glibc make zlib-devel # Install kernel - yum install kernel-devel-$(uname -r) + yum -y install kernel-devel-$(uname -r) # Enable Extra Packages for Enterprise Linux 7 - x86_64 sudo amazon-linux-extras install epel