Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ptaskTracer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Forget Julien
ptaskTracer
Commits
32ed98fb
Commit
32ed98fb
authored
Feb 16, 2019
by
Amine El Messaoudi
Browse files
Options
Downloads
Patches
Plain Diff
deadline for aperiodic task
parent
4a28773d
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/com/printer/svggen.java
+9
-3
9 additions, 3 deletions
src/com/printer/svggen.java
src/com/task/task.java
+9
-0
9 additions, 0 deletions
src/com/task/task.java
src/com/task/task_service.java
+12
-7
12 additions, 7 deletions
src/com/task/task_service.java
with
30 additions
and
10 deletions
src/com/printer/svggen.java
+
9
−
3
View file @
32ed98fb
...
...
@@ -213,10 +213,16 @@ public class svggen {
period
=
t
.
getPeriod
();
deadline
=
t
.
getDeadline
();
start
=
t
.
getStart
();
if
(
t
.
isPeriodic
())
{
if
(
period
!=
0
&&
deadline
!=
0
&&
start
!=
null
)
for
(
int
nb_period
=
0
;
((
start
-
this
.
start
+((
nb_period
/
1000000.0
)*
period
))*
this
.
scale
)<
this
.
width
;
nb_period
++)
{
this
.
f
.
wakeLine
((
start
-
this
.
start
+
(
nb_period
/
1000000.0
)*
period
)*
this
.
scale
,
(
1
+
this
.
curH
)*
this
.
task_hei
,
this
.
curH
*
this
.
task_hei
);
this
.
f
.
deadLine
((
start
-
this
.
start
+
((
nb_period
*
period
+
deadline
)/
1000000.0
))*
this
.
scale
,
(
1
+
this
.
curH
)*
this
.
task_hei
,
this
.
curH
*
this
.
task_hei
);
}
}
else
for
(
t_event
t_e
:
t
.
getEvents
())
if
(
t_e
.
getType
().
equals
(
Types
.
START
)
&&
deadline
!=
0
)
{
this
.
f
.
wakeLine
((
t_e
.
getValue
()-
this
.
start
)*
this
.
scale
,
(
1
+
this
.
curH
)*
this
.
task_hei
,
this
.
curH
*
this
.
task_hei
);
this
.
f
.
deadLine
((
t_e
.
getValue
()+(
deadline
/
1000000.0
)-
this
.
start
)*
this
.
scale
,
(
1
+
this
.
curH
)*
this
.
task_hei
,
this
.
curH
*
this
.
task_hei
);
}
this
.
curH
++;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/com/task/task.java
+
9
−
0
View file @
32ed98fb
...
...
@@ -22,6 +22,7 @@ public class task {
protected
Integer
deadline
=
null
;
protected
Double
start
=
null
;
protected
Boolean
state
=
false
;
protected
Boolean
periodic
=
false
;
protected
List
<
t_event
>
events
=
null
;
public
Integer
getId
()
{
...
...
@@ -56,6 +57,10 @@ public class task {
return
this
.
start
;
}
public
Boolean
isPeriodic
()
{
return
this
.
periodic
;
}
public
Boolean
isActivated
()
{
return
this
.
state
;
}
...
...
@@ -96,6 +101,10 @@ public class task {
this
.
start
=
start
;
}
public
void
setPeriodic
(
Boolean
state
)
{
this
.
periodic
=
state
;
}
public
void
setState
(
Boolean
state
)
{
this
.
state
=
state
;
}
...
...
This diff is collapsed.
Click to expand it.
src/com/task/task_service.java
+
12
−
7
View file @
32ed98fb
...
...
@@ -147,6 +147,7 @@ public class task_service {
int
i
=
0
,
idx
=
0
;
boolean
once
=
true
;
Double
period
=
0.0
;
Double
defwake
=
0.0
;
for
(
trace
tr
:
this
.
traces
)
{
i
=
0
;
if
(
t
.
getId
().
equals
(
tr
.
getTid
()))
{
...
...
@@ -167,26 +168,30 @@ public class task_service {
if
(((
ptask_tracepoint
)
tr
).
getState
().
equals
(
"\"b_wait_period\""
))
{
if
(
t
.
getStart
()
!=
null
)
events
.
add
(
new
t_event
(
Types
.
FINISH
,
tr
.
getTime
().
getTime
(
"seconde"
),
(
tr
.
getTime
().
getTime
(
"seconde"
)-
t
.
getStart
())<((
period
+
t
.
getDeadline
())/
1000000.0
)));
else
events
.
add
(
new
t_event
(
Types
.
FINISH
,
tr
.
getTime
().
getTime
(
"seconde"
)));
t
.
setPeriodic
(
true
);
}
else
if
(((
ptask_tracepoint
)
tr
).
getState
().
equals
(
"\"e_wait_period\""
))
{
events
.
add
(
new
t_event
(
Types
.
START
,
tr
.
getTime
().
getTime
(
"seconde"
)));
period
+=
t
.
getPeriod
();
t
.
setPeriodic
(
true
);
}
else
if
(((
ptask_tracepoint
)
tr
).
getState
().
equals
(
"\"b_wait_activation\""
))
{
if
(
t
.
getStart
()
!=
null
)
events
.
add
(
new
t_event
(
Types
.
FINISH
,
tr
.
getTime
().
getTime
(
"seconde"
),
(
tr
.
getTime
().
getTime
(
"seconde"
)-
t
.
getStart
())<((
period
+
t
.
getDeadline
()
)
/
1000000.0
)));
if
(
t
.
getStart
()
!=
null
)
events
.
add
(
new
t_event
(
Types
.
FINISH
,
tr
.
getTime
().
getTime
(
"seconde"
),
(
tr
.
getTime
().
getTime
(
"seconde"
)-
defwake
)<(
t
.
getDeadline
()/
1000000.0
)));
else
events
.
add
(
new
t_event
(
Types
.
FINISH
,
tr
.
getTime
().
getTime
(
"seconde"
)));
}
else
if
(((
ptask_tracepoint
)
tr
).
getState
().
equals
(
"\"e_wait_activation\""
))
{
events
.
add
(
new
t_event
(
Types
.
START
,
tr
.
getTime
().
getTime
(
"seconde"
)));
period
+=
t
.
getPeriod
();
t
.
setState
(
false
);
}
}
else
if
(((
ptask_tracepoint
)
tr
).
getState
().
equals
(
"\"e_wait_activation\""
))
{
t
.
setState
(
true
);
if
(
once
)
{
t
.
setStart
(
tr
.
getTime
().
getTime
(
"seconde"
));
events
.
add
(
new
t_event
(
Types
.
START
,
tr
.
getTime
().
getTime
(
"seconde"
)));
period
=
0.0
;
}
else
period
+=
t
.
getPeriod
();
once
=
false
;
events
.
add
(
new
t_event
(
Types
.
START
,
tr
.
getTime
().
getTime
(
"seconde"
)));
defwake
=
tr
.
getTime
().
getTime
(
"seconde"
);
}
}
else
if
(
tr
instanceof
sched_switch
)
{
events
.
add
(
new
t_event
(
Types
.
SWITCH_OUT
,
tr
.
getTime
().
getTime
(
"seconde"
),
((
sched_switch
)
tr
).
getNext_tid
()));
...
...
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