Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Merge pull request #20847 from dotnet-maestro-bot/merge/release/2.1-t…
Browse files Browse the repository at this point in the history
…o-release/2.2

[automated] Merge branch 'release/2.1' => 'release/2.2'
  • Loading branch information
RussKeldorph authored Nov 8, 2018
2 parents e887df8 + 4a4f528 commit 1655a06
Show file tree
Hide file tree
Showing 16 changed files with 191 additions and 88 deletions.
2 changes: 1 addition & 1 deletion BuildToolsVersion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.0-preview1-03131-04
2.2.0-preview1-03131-04
23 changes: 9 additions & 14 deletions cross/armel/tizen-fetch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ if [ ! -d $TMPDIR ]; then
mkdir -p $TMPDIR
fi

TIZEN_URL=http://download.tizen.org/releases/daily/tizen
TIZEN_URL=http://download.tizen.org/releases/milestone/tizen
BUILD_XML=build.xml
REPOMD_XML=repomd.xml
PRIMARY_XML=primary.xml
Expand Down Expand Up @@ -154,23 +154,18 @@ fetch_tizen_pkgs()
done
}

Inform "Initialize arm 4.0-base"
fetch_tizen_pkgs_init arm 4.0-base
Inform "Initialize arm base"
fetch_tizen_pkgs_init standard base
Inform "fetch common packages"
fetch_tizen_pkgs armv7l gcc glibc glibc-devel
fetch_tizen_pkgs armv7l gcc glibc glibc-devel libicu libicu-devel
fetch_tizen_pkgs noarch linux-glibc-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel
fetch_tizen_pkgs armv7l lldb lldb-devel libgcc libstdc++ libstdc++-devel libunwind libunwind-devel tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel
fetch_tizen_pkgs armv7l libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel krb5 krb5-devel libcurl libcurl-devel

Inform "Initialize standard 4.0-unified"
fetch_tizen_pkgs_init standard 4.0-unified
Inform "fetch common packages"
fetch_tizen_pkgs armv7l libicu-devel
Inform "fetch coreclr packages"
fetch_tizen_pkgs armv7l tizen-release lttng-ust-devel lttng-ust userspace-rcu-devel userspace-rcu
Inform "Initialize standard unified"
fetch_tizen_pkgs_init standard unified
Inform "fetch corefx packages"
fetch_tizen_pkgs armv7l gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel

fetch_tizen_pkgs armv7l gssdp gssdp-devel

4 changes: 2 additions & 2 deletions cross/armel/tizen/tizen-dotnet.ks
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ rootpw tizen
desktop --autologinuser=root
user --name root --groups audio,video --password 'tizen'

repo --name=standard --baseurl=http://download.tizen.org/releases/daily/tizen/4.0-unified/latest/repos/standard/packages/ --ssl_verify=no
repo --name=base --baseurl=http://download.tizen.org/releases/daily/tizen/4.0-base/latest/repos/arm/packages/ --ssl_verify=no
repo --name=standard --baseurl=http://download.tizen.org/releases/milestone/tizen/unified/latest/repos/standard/packages/ --ssl_verify=no
repo --name=base --baseurl=http://download.tizen.org/releases/milestone/tizen/base/latest/repos/standard/packages/ --ssl_verify=no

%packages
tar
Expand Down
27 changes: 19 additions & 8 deletions netci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ class Constants {
'Checked'
]
],
'Tizen': [
'armem': [
'Checked'
]
],
]

// A set of scenarios that are valid for arm/arm64/armlb tests run on hardware. This is a map from valid scenario name
Expand Down Expand Up @@ -999,7 +1004,7 @@ def static getDockerImageName(def architecture, def os, def isBuild) {
return "microsoft/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180404203310"
}
else if (os == 'Tizen') {
return "hqueue/dotnetcore:ubuntu1404_cross_prereqs_v4-tizen_rootfs"
return "tizendotnet/dotnet-buildtools-prereqs:ubuntu-16.04-cross-e435274-20180426002255-tizen-rootfs-5.0m1"
}
}
else if (architecture == 'arm') {
Expand Down Expand Up @@ -1737,15 +1742,21 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
case 'Ubuntu16.04':
assert scenario != 'innerloop'
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
break

case 'Tizen':
architecture = 'armel'

assert scenario != 'innerloop'
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
if (scenario == 'innerloop') {
if (configuration == 'Checked') {
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build and Test")
}
}
else {
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Build",
"(?i).*test\\W+${os}\\W+${architecture}\\W+Cross\\W+${configuration}\\W+Build.*")
}
break
}

Expand Down Expand Up @@ -1808,7 +1819,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
// Only Checked is an innerloop trigger.
if (configuration == 'Checked')
{
Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
}
break
case 'normal':
Expand Down Expand Up @@ -1859,7 +1870,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
switch (scenario) {
case 'innerloop':
if (configuration == 'Debug' && !isFlowJob) {
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build")
Utilities.addGithubPRTriggerForBranch(job, branch, "${os} ${architecture} Cross ${configuration} Innerloop Build", triggerString)
}

break
Expand Down Expand Up @@ -1887,7 +1898,7 @@ def static addTriggers(def job, def branch, def isPR, def architecture, def os,
switch (scenario) {
case 'innerloop':
if (configuration == 'Checked') {
Utilities.addDefaultPrivateGithubPRTriggerForBranch(job, branch, contextString, null, arm64Users)
Utilities.addPrivateGithubPRTriggerForBranch(job, branch, contextString, triggerString, null, arm64Users)
}

break
Expand Down
61 changes: 36 additions & 25 deletions src/corefx/System.Globalization.Native/icushim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,15 @@ FOR_ALL_ICU_FUNCTIONS
static void* libicuuc = nullptr;
static void* libicui18n = nullptr;

// .x.x.x, considering the max number of decimal digits for each component
static const int MaxICUVersionStringLength = 33;
#define VERSION_PREFIX_NONE ""
#define VERSION_PREFIX_SUSE "suse"

// .[suse]x.x.x, considering the max number of decimal digits for each component
static const int MaxICUVersionStringLength = sizeof(VERSION_PREFIX_SUSE) + 33;

#ifdef __APPLE__

bool FindICULibs(char* symbolName, char* symbolVersion)
bool FindICULibs(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
#ifndef OSX_ICU_LIBRARY_PATH
static_assert(false, "The ICU Library path is not defined");
Expand Down Expand Up @@ -63,11 +66,11 @@ static const int MaxSubICUVersion = 5;
// 1. Only majorVer is not equal to -1 => result is baseFileName.majorver
// 2. Only majorVer and minorVer are not equal to -1 => result is baseFileName.majorver.minorVer
// 3. All components are not equal to -1 => result is baseFileName.majorver.minorVer.subver
void GetVersionedLibFileName(const char* baseFileName, int majorVer, int minorVer, int subVer, char* result)
void GetVersionedLibFileName(const char* baseFileName, int majorVer, int minorVer, int subVer, const char* versionPrefix, char* result)
{
assert(majorVer != -1);

int nameLen = sprintf(result, "%s.%d", baseFileName, majorVer);
int nameLen = sprintf(result, "%s.%s%d", baseFileName, versionPrefix, majorVer);

if (minorVer != -1)
{
Expand Down Expand Up @@ -110,16 +113,16 @@ bool FindSymbolVersion(int majorVer, int minorVer, int subVer, char* symbolName,
}

// Try to open the necessary ICU libraries
bool OpenICULibraries(int majorVer, int minorVer, int subVer, char* symbolName, char* symbolVersion)
bool OpenICULibraries(int majorVer, int minorVer, int subVer, const char* versionPrefix, char* symbolName, char* symbolVersion)
{
char libicuucName[64];
char libicui18nName[64];

static_assert(sizeof("libicuuc.so") + MaxICUVersionStringLength <= sizeof(libicuucName), "The libicuucName is too small");
GetVersionedLibFileName("libicuuc.so", majorVer, minorVer, subVer, libicuucName);
GetVersionedLibFileName("libicuuc.so", majorVer, minorVer, subVer, versionPrefix, libicuucName);

static_assert(sizeof("libicui18n.so") + MaxICUVersionStringLength <= sizeof(libicui18nName), "The libicui18nName is too small");
GetVersionedLibFileName("libicui18n.so", majorVer, minorVer, subVer, libicui18nName);
GetVersionedLibFileName("libicui18n.so", majorVer, minorVer, subVer, versionPrefix, libicui18nName);

libicuuc = dlopen(libicuucName, RTLD_LAZY);
if (libicuuc != nullptr)
Expand All @@ -142,7 +145,7 @@ bool OpenICULibraries(int majorVer, int minorVer, int subVer, char* symbolName,
// environment variable.
// The format of the string in this variable is majorVer[.minorVer[.subVer]] (the brackets
// indicate optional parts).
bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
bool FindLibUsingOverride(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
char* versionOverride = getenv("CLR_ICU_VERSION_OVERRIDE");
if (versionOverride != nullptr)
Expand All @@ -154,7 +157,7 @@ bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
int matches = sscanf(versionOverride, "%d.%d.%d", &first, &second, &third);
if (matches > 0)
{
if (OpenICULibraries(first, second, third, symbolName, symbolVersion))
if (OpenICULibraries(first, second, third, versionPrefix, symbolName, symbolVersion))
{
return true;
}
Expand All @@ -165,21 +168,21 @@ bool FindLibUsingOverride(char* symbolName, char* symbolVersion)
}

// Search for library files with names including the major version.
bool FindLibWithMajorVersion(char* symbolName, char* symbolVersion)
bool FindLibWithMajorVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
// ICU packaging documentation (http://userguide.icu-project.org/packaging)
// describes applications link against the major (e.g. libicuuc.so.54).

// Select the version of ICU present at build time.
if (OpenICULibraries(MinICUVersion, -1, -1, symbolName, symbolVersion))
if (OpenICULibraries(MinICUVersion, -1, -1, versionPrefix, symbolName, symbolVersion))
{
return true;
}

// Select the highest supported version of ICU present on the local machine
for (int i = MaxICUVersion; i > MinICUVersion; i--)
{
if (OpenICULibraries(i, -1, -1, symbolName, symbolVersion))
if (OpenICULibraries(i, -1, -1, versionPrefix, symbolName, symbolVersion))
{
return true;
}
Expand All @@ -190,13 +193,13 @@ bool FindLibWithMajorVersion(char* symbolName, char* symbolVersion)

// Select the highest supported version of ICU present on the local machine
// Search for library files with names including the major and minor version.
bool FindLibWithMajorMinorVersion(char* symbolName, char* symbolVersion)
bool FindLibWithMajorMinorVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
for (int i = MaxICUVersion; i >= MinICUVersion; i--)
{
for (int j = MaxMinorICUVersion; j >= MinMinorICUVersion; j--)
{
if (OpenICULibraries(i, j, -1, symbolName, symbolVersion))
if (OpenICULibraries(i, j, -1, versionPrefix, symbolName, symbolVersion))
{
return true;
}
Expand All @@ -208,15 +211,15 @@ bool FindLibWithMajorMinorVersion(char* symbolName, char* symbolVersion)

// Select the highest supported version of ICU present on the local machine
// Search for library files with names including the major, minor and sub version.
bool FindLibWithMajorMinorSubVersion(char* symbolName, char* symbolVersion)
bool FindLibWithMajorMinorSubVersion(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
for (int i = MaxICUVersion; i >= MinICUVersion; i--)
{
for (int j = MaxMinorICUVersion; j >= MinMinorICUVersion; j--)
{
for (int k = MaxSubICUVersion; k >= MinSubICUVersion; k--)
{
if (OpenICULibraries(i, j, k, symbolName, symbolVersion))
if (OpenICULibraries(i, j, k, versionPrefix, symbolName, symbolVersion))
{
return true;
}
Expand All @@ -227,12 +230,13 @@ bool FindLibWithMajorMinorSubVersion(char* symbolName, char* symbolVersion)
return false;
}

bool FindICULibs(char* symbolName, char* symbolVersion)

bool FindICULibs(const char* versionPrefix, char* symbolName, char* symbolVersion)
{
return FindLibUsingOverride(symbolName, symbolVersion) ||
FindLibWithMajorVersion(symbolName, symbolVersion) ||
FindLibWithMajorMinorVersion(symbolName, symbolVersion) ||
FindLibWithMajorMinorSubVersion(symbolName, symbolVersion);
return FindLibUsingOverride(versionPrefix, symbolName, symbolVersion) ||
FindLibWithMajorVersion(versionPrefix, symbolName, symbolVersion) ||
FindLibWithMajorMinorVersion(versionPrefix, symbolName, symbolVersion) ||
FindLibWithMajorMinorSubVersion(versionPrefix, symbolName, symbolVersion);
}

#endif // __APPLE__
Expand All @@ -246,8 +250,15 @@ extern "C" int32_t GlobalizationNative_LoadICU()
char symbolName[128];
char symbolVersion[MaxICUVersionStringLength + 1] = "";

if (!FindICULibs(symbolName, symbolVersion))
return 0;
if (!FindICULibs(VERSION_PREFIX_NONE, symbolName, symbolVersion))
{
#ifndef __APPLE__
if (!FindICULibs(VERSION_PREFIX_SUSE, symbolName, symbolVersion))
#endif
{
return 0;
}
}

// Get pointers to all the ICU functions that are needed
#define PER_FUNCTION_BLOCK(fn, lib) \
Expand Down Expand Up @@ -290,4 +301,4 @@ void ShutdownICUShim()
dlclose(libicui18n);
libicui18n = nullptr;
}
}
}
31 changes: 29 additions & 2 deletions src/gc/unix/cgroup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Module Name:
#define PROC_CGROUP_FILENAME "/proc/self/cgroup"
#define PROC_STATM_FILENAME "/proc/self/statm"
#define MEM_LIMIT_FILENAME "/memory.limit_in_bytes"
#define MEM_USAGE_FILENAME "/memory.usage_in_bytes"
#define CFS_QUOTA_FILENAME "/cpu.cfs_quota_us"
#define CFS_PERIOD_FILENAME "/cpu.cfs_period_us"

Expand Down Expand Up @@ -74,6 +75,27 @@ class CGroup
return result;
}

bool GetPhysicalMemoryUsage(size_t *val)
{
char *mem_usage_filename = nullptr;
bool result = false;

if (m_memory_cgroup_path == nullptr)
return result;

size_t len = strlen(m_memory_cgroup_path);
len += strlen(MEM_USAGE_FILENAME);
mem_usage_filename = (char*)malloc(len+1);
if (mem_usage_filename == nullptr)
return result;

strcpy(mem_usage_filename, m_memory_cgroup_path);
strcat(mem_usage_filename, MEM_USAGE_FILENAME);
result = ReadMemoryValueFromFile(mem_usage_filename, val);
free(mem_usage_filename);
return result;
}

bool GetCpuLimit(uint32_t *val)
{
long long quota;
Expand Down Expand Up @@ -427,19 +449,24 @@ size_t GetRestrictedPhysicalMemoryLimit()
return physical_memory_limit;
}

bool GetWorkingSetSize(size_t* val)
bool GetPhysicalMemoryUsed(size_t* val)
{
bool result = false;
size_t linelen;
char* line = nullptr;
CGroup cgroup;

if (val == nullptr)
return false;

// Linux uses cgroup usage to trigger oom kills.
if (cgroup.GetPhysicalMemoryUsage(val))
return true;

// process resident set size.
FILE* file = fopen(PROC_STATM_FILENAME, "r");
if (file != nullptr && getline(&line, &linelen, file) != -1)
{

char* context = nullptr;
char* strTok = strtok_r(line, " ", &context);
strTok = strtok_r(nullptr, " ", &context);
Expand Down
4 changes: 2 additions & 2 deletions src/gc/unix/gcenv.unix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ static uint8_t* g_helperPage = 0;
static pthread_mutex_t g_flushProcessWriteBuffersMutex;

size_t GetRestrictedPhysicalMemoryLimit();
bool GetWorkingSetSize(size_t* val);
bool GetPhysicalMemoryUsed(size_t* val);
bool GetCpuLimit(uint32_t* val);

static size_t g_RestrictedPhysicalMemoryLimit = 0;
Expand Down Expand Up @@ -623,7 +623,7 @@ void GCToOSInterface::GetMemoryStatus(uint32_t* memory_load, uint64_t* available

// Get the physical memory in use - from it, we can get the physical memory available.
// We do this only when we have the total physical memory available.
if (total > 0 && GetWorkingSetSize(&used))
if (total > 0 && GetPhysicalMemoryUsed(&used))
{
available = total > used ? total-used : 0;
load = (uint32_t)(((float)used * 100) / (float)total);
Expand Down
Loading

0 comments on commit 1655a06

Please sign in to comment.