Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OAI-RAN-5G-sheduler_MaxTBS
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
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
MAQ5G-PFC
OAI-RAN-5G-sheduler_MaxTBS
Commits
f8ae07d3
Commit
f8ae07d3
authored
8 years ago
by
Cedric Roux
Browse files
Options
Downloads
Patches
Plain Diff
bugfixes in view/time.c
parent
2e7ab60d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/utils/T/tracer/view/time.c
+22
-4
22 additions, 4 deletions
common/utils/T/tracer/view/time.c
with
22 additions
and
4 deletions
common/utils/T/tracer/view/time.c
+
22
−
4
View file @
f8ae07d3
...
...
@@ -97,6 +97,7 @@ static void *time_thread(void *_this)
struct
timespec
tstart
;
struct
timespec
tnext
;
struct
plot
*
p
;
int64_t
pixel_length
;
while
(
1
)
{
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
...
...
@@ -106,14 +107,17 @@ static void *time_thread(void *_this)
/* TODO: optimize/cleanup */
/* use rounded pixel_length */
pixel_length
=
this
->
pixel_length
;
tnext
=
time_add
(
this
->
latest_time
,(
struct
timespec
){
tv_sec
:
0
,
tv_nsec
:
1
});
tstart
=
time_sub
(
tnext
,
nano_to_time
(
this
->
pixel_length
*
width
));
tstart
=
time_sub
(
tnext
,
nano_to_time
(
pixel_length
*
width
));
for
(
l
=
0
;
l
<
this
->
subcount
;
l
++
)
{
for
(
i
=
0
;
i
<
width
;
i
++
)
{
struct
timespec
tick_start
,
tick_end
;
tick_start
=
time_add
(
tstart
,
nano_to_time
(
this
->
pixel_length
*
i
));
tick_end
=
time_add
(
tick_start
,
nano_to_time
(
this
->
pixel_length
-
1
));
tick_start
=
time_add
(
tstart
,
nano_to_time
(
pixel_length
*
i
));
tick_end
=
time_add
(
tick_start
,
nano_to_time
(
pixel_length
-
1
));
/* look for a nano between tick_start and tick_end */
/* TODO: optimize */
for
(
t
=
0
;
t
<
this
->
tsize
;
t
++
)
{
...
...
@@ -131,7 +135,7 @@ static void *time_thread(void *_this)
struct
timespec
nano
=
(
struct
timespec
){
tv_sec
:
current_second
,
tv_nsec
:
p
->
nano
[
n
]};
if
(
time_cmp
(
tick_start
,
nano
)
<=
0
&&
time_cmp
(
nano
,
tick_end
)
<
0
)
time_cmp
(
nano
,
tick_end
)
<
=
0
)
goto
gotit
;
}
}
...
...
@@ -157,11 +161,15 @@ static void scroll(void *private, gui *g,
struct
time
*
this
=
private
;
double
mul
=
1
.
2
;
double
pixel_length
;
int64_t
old_px_len_rounded
;
if
(
pthread_mutex_lock
(
&
this
->
lock
))
abort
();
old_px_len_rounded
=
this
->
pixel_length
;
if
(
!
strcmp
(
notification
,
"scrollup"
))
mul
=
1
/
mul
;
again:
pixel_length
=
this
->
pixel_length
*
mul
;
if
(
pixel_length
<
1
)
pixel_length
=
1
;
if
(
pixel_length
>
(
double
)
3600
*
1000000000
)
...
...
@@ -169,6 +177,16 @@ static void scroll(void *private, gui *g,
this
->
pixel_length
=
pixel_length
;
/* due to rounding, we may need to zoom by more than 1.2 with
* very close lookup, otherwise the user zooming command won't
* be visible (say length is 2.7, zoom in, new length is 2.25,
* and rounding is 2, same value, no change, no feedback to user => bad)
* TODO: make all this cleaner
*/
if
(
pixel_length
!=
1
&&
pixel_length
!=
(
double
)
3600
*
1000000000
&&
(
int64_t
)
pixel_length
==
old_px_len_rounded
)
goto
again
;
if
(
pthread_mutex_unlock
(
&
this
->
lock
))
abort
();
}
...
...
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