Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
boinc
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
einsteinathome
boinc
Commits
0880aea0
Unverified
Commit
0880aea0
authored
1 year ago
by
Vitalii Koshura
Committed by
GitHub
1 year ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #5323 from BOINC/dpa_libc
Scheduler: add <min_libc_version> option to plan_class_spec.xml
parents
e17b12cb
651f1b04
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
sched/plan_class_spec.cpp
+29
-0
29 additions, 0 deletions
sched/plan_class_spec.cpp
sched/plan_class_spec.h
+2
-1
2 additions, 1 deletion
sched/plan_class_spec.h
with
31 additions
and
1 deletion
sched/plan_class_spec.cpp
+
29
−
0
View file @
0880aea0
...
...
@@ -80,6 +80,18 @@ static double os_version_num(HOST h) {
return
0
;
}
// if os_version has [...|libc 2.27 ...], return 227. else 0
//
static
int
libc_version
(
HOST
&
h
)
{
char
*
p
=
strstr
(
h
.
os_version
,
"|libc "
);
if
(
!
p
)
return
0
;
p
+=
strlen
(
"|libc "
);
int
maj
,
min
;
int
n
=
sscanf
(
p
,
"%d.%d"
,
&
maj
,
&
min
);
if
(
n
!=
2
)
return
0
;
return
maj
*
100
+
min
;
}
// parse version# from "(Android 4.3.1)" or "(Android 4.3)" or "(Android 4)"
//
static
int
android_version_num
(
HOST
h
)
{
...
...
@@ -383,6 +395,21 @@ bool PLAN_CLASS_SPEC::check(
}
}
// libc version (linux)
//
if
(
min_libc_version
)
{
int
v
=
libc_version
(
sreq
.
host
);
if
(
v
<
min_libc_version
)
{
if
(
config
.
debug_version_select
)
{
log_messages
.
printf
(
MSG_NORMAL
,
"[version] plan_class_spec: libc version too low (%d < %d)
\n
"
,
v
,
min_libc_version
);
}
return
false
;
}
}
// CPU vendor and model
//
if
(
have_cpu_vendor_regex
&&
regexec
(
&
(
cpu_vendor_regex
),
sreq
.
host
.
p_vendor
,
0
,
NULL
,
0
))
{
...
...
@@ -1099,6 +1126,7 @@ int PLAN_CLASS_SPEC::parse(XML_PARSER& xp) {
if
(
xp
.
parse_double
(
"max_os_version"
,
max_os_version
))
continue
;
if
(
xp
.
parse_int
(
"min_android_version"
,
min_android_version
))
continue
;
if
(
xp
.
parse_int
(
"max_android_version"
,
max_android_version
))
continue
;
if
(
xp
.
parse_int
(
"min_libc_version"
,
min_libc_version
))
continue
;
if
(
xp
.
parse_str
(
"project_prefs_tag"
,
project_prefs_tag
,
sizeof
(
project_prefs_tag
)))
continue
;
if
(
xp
.
parse_str
(
"project_prefs_regex"
,
buf
,
sizeof
(
buf
)))
{
if
(
regcomp
(
&
(
project_prefs_regex
),
buf
,
REG_EXTENDED
|
REG_NOSUB
)
)
{
...
...
@@ -1201,6 +1229,7 @@ PLAN_CLASS_SPEC::PLAN_CLASS_SPEC() {
max_os_version
=
0
;
min_android_version
=
0
;
max_android_version
=
0
;
min_libc_version
=
0
;
strcpy
(
project_prefs_tag
,
""
);
have_project_prefs_regex
=
false
;
project_prefs_default_true
=
false
;
...
...
This diff is collapsed.
Click to expand it.
sched/plan_class_spec.h
+
2
−
1
View file @
0880aea0
...
...
@@ -23,7 +23,7 @@
#include
<regex.h>
// Represents a plan class, as specified in XML
// if you add anything here, initialize i
f
in the constructor
// if you add anything here, initialize i
t
in the constructor
//
struct
PLAN_CLASS_SPEC
{
char
name
[
256
];
...
...
@@ -51,6 +51,7 @@ struct PLAN_CLASS_SPEC {
double
max_os_version
;
int
min_android_version
;
int
max_android_version
;
int
min_libc_version
;
char
project_prefs_tag
[
256
];
bool
have_project_prefs_regex
;
regex_t
project_prefs_regex
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment