Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kernel Program Behaviour Models
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
felixkhals
Kernel Program Behaviour Models
Commits
3772b6a0
Commit
3772b6a0
authored
2 years ago
by
ManuelWelte
Browse files
Options
Downloads
Patches
Plain Diff
Check errors; Remove warnings
parent
b63a6a0e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
kernel/sched/pb.c
+26
-6
26 additions, 6 deletions
kernel/sched/pb.c
with
26 additions
and
6 deletions
kernel/sched/pb.c
+
26
−
6
View file @
3772b6a0
...
@@ -14,22 +14,37 @@ typedef struct pb_plan pb_plan_t;
...
@@ -14,22 +14,37 @@ typedef struct pb_plan pb_plan_t;
typedef
struct
pb_plan_info
pb_plan_info_t
;
typedef
struct
pb_plan_info
pb_plan_info_t
;
SYSCALL_DEFINE1
(
pb_set_plan_debug
,
pb_plan_info_t
*
,
plan_info
)
{
SYSCALL_DEFINE1
(
pb_set_plan_debug
,
pb_plan_info_t
*
,
plan_info
)
{
pb_plan_info_t
_plan_info
;
pb_plan_info_t
_plan_info
;
struct
task_struct
*
task
;
struct
rq
*
rq
;
struct
pb_rq
*
pb_rq
;
unsigned
long
copied
;
unsigned
int
i
;
int
res
;
int
res
;
res
=
copy_from_user
(
&
_plan_info
,
plan_info
,
sizeof
(
pb_plan_info_t
));
struct
task_struct
*
task
=
find_task_by_vpid
(
_plan_info
.
pid
);
copied
=
copy_from_user
(
&
_plan_info
,
plan_info
,
sizeof
(
pb_plan_info_t
));
if
(
copied
!=
sizeof
(
pb_plan_info_t
)){
return
-
1
;
}
task
=
find_task_by_vpid
(
_plan_info
.
pid
);
if
(
!
task
)
{
return
-
1
;
}
task
->
sched_class
=
&
pb_sched_class
;
task
->
sched_class
=
&
pb_sched_class
;
struct
rq
*
rq
;
rq
=
this_rq
();
rq
=
this_rq
();
struct
pb_rq
*
pb_rq
=
&
rq
->
pb
;
pb_rq
=
&
rq
->
pb
;
set_pb_plan_size
(
pb_rq
,
_plan_info
.
num_tasks
);
set_pb_plan_size
(
pb_rq
,
_plan_info
.
num_tasks
);
unsigned
int
i
;
for
(
i
=
0
;
i
<
_plan_info
.
num_tasks
;
i
++
)
{
for
(
i
=
0
;
i
<
_plan_info
.
num_tasks
;
i
++
)
{
set_pb_plan_entry
(
set_pb_plan_entry
(
pb_rq
,
pb_rq
,
...
@@ -40,10 +55,15 @@ SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) {
...
@@ -40,10 +55,15 @@ SYSCALL_DEFINE1(pb_set_plan_debug, pb_plan_info_t*, plan_info) {
);
);
}
}
pb_submit_plan
(
rq
);
res
=
pb_submit_plan
(
rq
);
if
(
res
==
-
1
)
{
return
res
;
}
// TODO:
// TODO:
// - perf_event stuff
// - perf_event stuff
// - syscall for error message retrieval?
// - ...
// - ...
return
0
;
return
0
;
}
}
...
...
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