Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • eclipse/oniro-core/oniro
  • landgraf/oniro
  • zyga/oniro
  • mrybczyn/oniro
  • agherzan/oniro
  • pcoval/oniro
  • tony3oo3/oniro
  • stefanschmidt/oniro
  • waykovalenko/oniro
  • bero/oniro
  • esben/oniro
  • robertd/oniro
  • pidge/oniro
  • shettygururaj/oniro
  • thierrye/oniro
  • sradakovi/oniro
  • dricci783/oniro
  • ektor5/oniro
  • fldn/oniro
  • lucafavaretto/oniro
  • lucazizolfi/oniro
  • artemkondratiuk/oniro
  • lucaseri/oniro
  • gwozdzcfs/oniro
  • kristis/oniro
  • brgl/oniro
  • heurtemattes/oniro
  • idlethread/oniro
  • lquach/oniro
  • ghassaneben/oniro
  • heurtemattes/oniro-bitbake
  • kzarka/oniro
  • heurtemattes/oniro-migration
  • pastanki/oniro
  • malowe/oniro
  • chaseqi/oniro
  • mrfrank/oniro
37 results
Show changes
Showing
with 300 additions and 7 deletions
...@@ -43,17 +43,17 @@ diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc ...@@ -43,17 +43,17 @@ diff --git a/gcc/config/i386/i386-expand.cc b/gcc/config/i386/i386-expand.cc
index ac69eed4d32..ffaa44a16fc 100644 index ac69eed4d32..ffaa44a16fc 100644
--- a/gcc/config/i386/i386-expand.cc --- a/gcc/config/i386/i386-expand.cc
+++ b/gcc/config/i386/i386-expand.cc +++ b/gcc/config/i386/i386-expand.cc
@@ -11038,10 +11038,10 @@ ix86_expand_builtin (tree exp, rtx target, rtx subtarget, @@ -12338,10 +12338,10 @@ ix86_expand_builtin (tree exp, rtx targe
{ {
case IX86_BUILTIN_CPU_INIT: case IX86_BUILTIN_CPU_INIT:
{ {
- /* Make it call __cpu_indicator_init in libgcc. */ - /* Make it call __cpu_indicator_init in libgcc. */
+ /* Make it call __cpu_indicator_init_local in libgcc.a. */ + /* Make it call __cpu_indicator_init_local in libgcc.a. */
tree call_expr, fndecl, type; tree call_expr, fndecl, type;
type = build_function_type_list (integer_type_node, NULL_TREE); type = build_function_type_list (integer_type_node, NULL_TREE);
- fndecl = build_fn_decl ("__cpu_indicator_init", type); - fndecl = build_fn_decl ("__cpu_indicator_init", type);
+ fndecl = build_fn_decl ("__cpu_indicator_init_local", type); + fndecl = build_fn_decl ("__cpu_indicator_init_local", type);
call_expr = build_call_expr (fndecl, 0); call_expr = build_call_expr (fndecl, 0);
return expand_expr (call_expr, target, mode, EXPAND_NORMAL); return expand_expr (call_expr, target, mode, EXPAND_NORMAL);
} }
diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c diff --git a/libgcc/config/i386/cpuinfo.c b/libgcc/config/i386/cpuinfo.c
......
SUMMARY = "GN is a meta-build system that generates build files for Ninja" SUMMARY = "GN is a meta-build system that generates build files for Ninja"
DEPENDS += "ninja-native"
LICENSE = "BSD-3-Clause" LICENSE = "BSD-3-Clause"
LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d" LIC_FILES_CHKSUM = "file://LICENSE;md5=0fca02217a5d49a14dfe2d11837bb34d"
...@@ -11,6 +9,8 @@ PV = "0+git${SRCPV}" ...@@ -11,6 +9,8 @@ PV = "0+git${SRCPV}"
S = "${WORKDIR}/git" S = "${WORKDIR}/git"
B = "${WORKDIR}/build" B = "${WORKDIR}/build"
inherit ninja
# Currently fails to build with clang, eg: # Currently fails to build with clang, eg:
# https://errors.yoctoproject.org/Errors/Details/610602/ # https://errors.yoctoproject.org/Errors/Details/610602/
# https://errors.yoctoproject.org/Errors/Details/610486/ # https://errors.yoctoproject.org/Errors/Details/610486/
......
From 250747d4c422c893aaf516ce19fabb77a7926968 Mon Sep 17 00:00:00 2001
From: Mateusz Guzik <mjguzik@gmail.com>
Date: Sat, 28 Nov 2020 23:54:09 +0000
Subject: [PATCH] feat: support cpu limit by cgroups on linux
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-Status: Backport [540be336f5639ee6a89e959e6f9f434c01900ecf]
---
src/util.cc | 169 +++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 166 insertions(+), 3 deletions(-)
diff --git a/src/util.cc b/src/util.cc
index c76f730..d609e49 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -49,6 +49,13 @@
#include <libperfstat.h>
#elif defined(linux) || defined(__GLIBC__)
#include <sys/sysinfo.h>
+#include <fstream>
+#include <map>
+#include "string_piece_util.h"
+#endif
+
+#if defined(__FreeBSD__)
+#include <sys/cpuset.h>
#endif
#include "edit_distance.h"
@@ -481,20 +488,176 @@ string StripAnsiEscapeCodes(const string& in) {
return stripped;
}
+#if defined(linux) || defined(__GLIBC__)
+std::pair<int64_t, bool> readCount(const std::string& path) {
+ std::ifstream file(path.c_str());
+ if (!file.is_open())
+ return std::make_pair(0, false);
+ int64_t n = 0;
+ file >> n;
+ if (file.good())
+ return std::make_pair(n, true);
+ return std::make_pair(0, false);
+}
+
+struct MountPoint {
+ int mountId;
+ int parentId;
+ StringPiece deviceId;
+ StringPiece root;
+ StringPiece mountPoint;
+ vector<StringPiece> options;
+ vector<StringPiece> optionalFields;
+ StringPiece fsType;
+ StringPiece mountSource;
+ vector<StringPiece> superOptions;
+ bool parse(const string& line) {
+ vector<StringPiece> pieces = SplitStringPiece(line, ' ');
+ if (pieces.size() < 10)
+ return false;
+ size_t optionalStart = 0;
+ for (size_t i = 6; i < pieces.size(); i++) {
+ if (pieces[i] == "-") {
+ optionalStart = i + 1;
+ break;
+ }
+ }
+ if (optionalStart == 0)
+ return false;
+ if (optionalStart + 3 != pieces.size())
+ return false;
+ mountId = atoi(pieces[0].AsString().c_str());
+ parentId = atoi(pieces[1].AsString().c_str());
+ deviceId = pieces[2];
+ root = pieces[3];
+ mountPoint = pieces[4];
+ options = SplitStringPiece(pieces[5], ',');
+ optionalFields =
+ vector<StringPiece>(&pieces[6], &pieces[optionalStart - 1]);
+ fsType = pieces[optionalStart];
+ mountSource = pieces[optionalStart + 1];
+ superOptions = SplitStringPiece(pieces[optionalStart + 2], ',');
+ return true;
+ }
+ string translate(string& path) const {
+ // path must be sub dir of root
+ if (path.compare(0, root.len_, root.str_, root.len_) != 0) {
+ return string();
+ }
+ path.erase(0, root.len_);
+ if (path == ".." || (path.length() > 2 && path.compare(0, 3, "../") == 0)) {
+ return string();
+ }
+ return mountPoint.AsString() + "/" + path;
+ }
+};
+
+struct CGroupSubSys {
+ int id;
+ string name;
+ vector<string> subsystems;
+ bool parse(string& line) {
+ size_t first = line.find(':');
+ if (first == string::npos)
+ return false;
+ line[first] = '\0';
+ size_t second = line.find(':', first + 1);
+ if (second == string::npos)
+ return false;
+ line[second] = '\0';
+ id = atoi(line.c_str());
+ name = line.substr(second + 1);
+ vector<StringPiece> pieces =
+ SplitStringPiece(StringPiece(line.c_str() + first + 1), ',');
+ for (size_t i = 0; i < pieces.size(); i++) {
+ subsystems.push_back(pieces[i].AsString());
+ }
+ return true;
+ }
+};
+
+map<string, string> ParseMountInfo(map<string, CGroupSubSys>& subsystems) {
+ map<string, string> cgroups;
+ ifstream mountinfo("/proc/self/mountinfo");
+ if (!mountinfo.is_open())
+ return cgroups;
+ while (!mountinfo.eof()) {
+ string line;
+ getline(mountinfo, line);
+ MountPoint mp;
+ if (!mp.parse(line))
+ continue;
+ if (mp.fsType != "cgroup")
+ continue;
+ for (size_t i = 0; i < mp.superOptions.size(); i++) {
+ string opt = mp.superOptions[i].AsString();
+ map<string, CGroupSubSys>::iterator subsys = subsystems.find(opt);
+ if (subsys == subsystems.end())
+ continue;
+ string newPath = mp.translate(subsys->second.name);
+ if (!newPath.empty())
+ cgroups.insert(make_pair(opt, newPath));
+ }
+ }
+ return cgroups;
+}
+
+map<string, CGroupSubSys> ParseSelfCGroup() {
+ map<string, CGroupSubSys> cgroups;
+ ifstream cgroup("/proc/self/cgroup");
+ if (!cgroup.is_open())
+ return cgroups;
+ string line;
+ while (!cgroup.eof()) {
+ getline(cgroup, line);
+ CGroupSubSys subsys;
+ if (!subsys.parse(line))
+ continue;
+ for (size_t i = 0; i < subsys.subsystems.size(); i++) {
+ cgroups.insert(make_pair(subsys.subsystems[i], subsys));
+ }
+ }
+ return cgroups;
+}
+
+int ParseCPUFromCGroup() {
+ map<string, CGroupSubSys> subsystems = ParseSelfCGroup();
+ map<string, string> cgroups = ParseMountInfo(subsystems);
+ map<string, string>::iterator cpu = cgroups.find("cpu");
+ if (cpu == cgroups.end())
+ return -1;
+ std::pair<int64_t, bool> quota = readCount(cpu->second + "/cpu.cfs_quota_us");
+ if (!quota.second || quota.first == -1)
+ return -1;
+ std::pair<int64_t, bool> period =
+ readCount(cpu->second + "/cpu.cfs_period_us");
+ if (!period.second)
+ return -1;
+ return quota.first / period.first;
+}
+#endif
+
int GetProcessorCount() {
#ifdef _WIN32
return GetActiveProcessorCount(ALL_PROCESSOR_GROUPS);
#else
-#ifdef CPU_COUNT
+ int cgroupCount = -1;
+ int schedCount = -1;
+#if defined(linux) || defined(__GLIBC__)
+ cgroupCount = ParseCPUFromCGroup();
+#endif
// The number of exposed processors might not represent the actual number of
// processors threads can run on. This happens when a CPU set limitation is
// active, see https://github.com/ninja-build/ninja/issues/1278
+#ifdef CPU_COUNT
cpu_set_t set;
if (sched_getaffinity(getpid(), sizeof(set), &set) == 0) {
- return CPU_COUNT(&set);
+ schedCount = CPU_COUNT(&set);
}
#endif
- return sysconf(_SC_NPROCESSORS_ONLN);
+ if (cgroupCount >= 0 && schedCount >= 0) return std::min(cgroupCount, schedCount);
+ if (cgroupCount < 0 && schedCount < 0) return sysconf(_SC_NPROCESSORS_ONLN);
+ return std::max(cgroupCount, schedCount);
#endif
}
--
2.25.1
From fe9fc7d85fd3b0e2d444923851c176c5f80979ac Mon Sep 17 00:00:00 2001
From: Andrei Gherzan <andrei.gherzan@huawei.com>
Date: Thu, 14 Jul 2022 14:25:20 +0200
Subject: [PATCH] Introduce MAXLOAD_NINJA for setting average load
This introduces an environment variable that ninja will take into
consideration for the maximum load average: MAXLOAD_NINJA. The existing
command line argument (`l`) overrides the value of MAXLOAD_NINJA.
Signed-off-by: Andrei Gherzan <andrei.gherzan@huawei.com>
Upstream-Status: Pending
---
src/ninja.cc | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/ninja.cc b/src/ninja.cc
index 471a023c..992c7532 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -1260,6 +1260,17 @@ int ReadFlags(int* argc, char*** argv,
Options* options, BuildConfig* config) {
config->parallelism = GuessParallelism();
+ // Have the ability to set the maximum load average via an environment variable.
+ const char * max_load_average_env = getenv("MAXLOAD_NINJA");
+ if (max_load_average_env != NULL) {
+ char* end;
+ double value = strtod(max_load_average_env, &end);
+ if (*end != 0 || value < 0)
+ Fatal("invalid max load average in MAXLOAD_NINJA environment variable");
+ if (value != 0)
+ config->max_load_average = value;
+ }
+
enum { OPT_VERSION = 1 };
const option kLongOptions[] = {
{ "help", no_argument, NULL, 'h' },
--
2.25.1
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI += "\
file://0001-feat-support-cpu-limit-by-cgroups-on-linux.patch \
file://0002-Introduce-MAXLOAD_NINJA-for-setting-average-load.patch \
"
From e421613e8f825508afa9a0b54d33085557c37441 Mon Sep 17 00:00:00 2001
From: Behdad Esfahbod <behdad@behdad.org>
Date: Wed, 1 Jun 2022 09:07:57 -0600
Subject: [PATCH] [sbix] Fix conditional
Signed-off: Pavel Zhukov <pavel.zhukov@huawei.com>
Upstream-Status: Submitted
[https://lists.openembedded.org/g/openembedded-core/message/168163]
---
src/hb-ot-color-sbix-table.hh | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hb-ot-color-sbix-table.hh b/src/hb-ot-color-sbix-table.hh
index 6efae43cda..d0e2235fb2 100644
--- a/src/hb-ot-color-sbix-table.hh
+++ b/src/hb-ot-color-sbix-table.hh
@@ -298,7 +298,7 @@ struct sbix
const PNGHeader &png = *blob->as<PNGHeader>();
- if (png.IHDR.height >= 65536 | png.IHDR.width >= 65536)
+ if (png.IHDR.height >= 65536 || png.IHDR.width >= 65536)
{
hb_blob_destroy (blob);
return false;
# SPDX-FileCopyrightText: Huawei Inc.
# SPDX-License-Identifier: Apache-2.0
FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
SRC_URI:append = " file://e421613e8f825508afa9a0b54d33085557c37441.patch "