Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
spbro
OpenXG-RAN
Commits
61c9fa94
Commit
61c9fa94
authored
Apr 29, 2021
by
frtabu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enhance cpu measurments to better support parallelism via using a message queue.
parent
272b42e8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
2 deletions
+52
-2
openair1/PHY/TOOLS/time_meas.c
openair1/PHY/TOOLS/time_meas.c
+38
-1
openair1/PHY/TOOLS/time_meas.h
openair1/PHY/TOOLS/time_meas.h
+14
-1
No files found.
openair1/PHY/TOOLS/time_meas.c
View file @
61c9fa94
...
...
@@ -23,12 +23,20 @@
#include "time_meas.h"
#include <math.h>
#include <unistd.h>
#include <string.h>
#include "assertions.h"
#ifndef PHYSIM
#include "common/config/config_userapi.h"
#endif
// global var for openair performance profiler
int
opp_enabled
=
0
;
double
cpu_freq_GHz
__attribute__
((
aligned
(
32
)));
double
cpu_freq_GHz
__attribute__
((
aligned
(
32
)))
=
0
.
0
;
#ifndef PHYSIM
static
uint32_t
max_cpumeasur
;
time_stats_t
**
measur_table
;
#endif
double
get_cpu_freq_GHz
(
void
)
{
if
(
cpu_freq_GHz
<
1
)
{
...
...
@@ -133,3 +141,32 @@ double get_time_meas_us(time_stats_t *ts)
return
0
;
}
#ifndef PHYSIM
int
register_meas
(
char
*
name
,
time_stats_t
*
dst_ts
)
{
for
(
int
i
=
0
;
i
<
max_cpumeasur
;
i
++
)
{
if
(
measur_table
[
i
]
==
NULL
)
{
measur_table
[
i
]
=
(
time_stats_t
*
)
malloc
(
sizeof
(
time_stats_t
));
memset
(
measur_table
[
i
]
,
0
,
sizeof
(
time_stats_t
));
measur_table
[
i
]
->
meas_name
=
strdup
(
name
);
measur_table
[
i
]
->
meas_index
=
i
;
return
i
;
}
}
return
-
1
;
}
void
init_meas
(
void
)
{
paramdef_t
cpumeasur_params
[]
=
CPUMEASUR_PARAMS_DESC
;
int
numparams
=
sizeof
(
cpumeasur_params
)
/
sizeof
(
paramdef_t
);
int
ret
=
config_get
(
cpumeasur_params
,
numparams
,
CPUMEASUR_SECTION
);
AssertFatal
(
ret
>=
0
,
"cpumeasur configuration couldn't be performed"
);
measur_table
=
calloc
(
max_cpumeasur
,
sizeof
(
time_stats_t
*
));
AssertFatal
(
measur_table
!=
NULL
,
"couldn't allocate %u cpu measurements entries
\n
"
,
max_cpumeasur
);
}
#endif
openair1/PHY/TOOLS/time_meas.h
View file @
61c9fa94
...
...
@@ -34,7 +34,7 @@
// global var to enable openair performance profiler
extern
int
opp_enabled
;
extern
double
cpu_freq_GHz
__attribute__
((
aligned
(
32
)));;
// structure to store data to compute cpu measurment
#if defined(__x86_64__) || defined(__i386__)
typedef
struct
{
long
long
in
;
...
...
@@ -44,6 +44,8 @@ typedef struct {
long
long
max
;
int
trials
;
int
meas_flag
;
char
*
meas_name
;
/*!< \brief name to use when printing the measure (not used for PHY simulators)*/
int
meas_index
;
/*!< \brief index of this measure in the measure array (not used for PHY simulators)*/
}
time_stats_t
;
#elif defined(__arm__)
typedef
struct
{
...
...
@@ -137,4 +139,15 @@ static inline void copy_meas(time_stats_t *dst_ts,time_stats_t *src_ts) {
dst_ts
->
max
=
src_ts
->
max
;
}
}
#ifndef PHYSIM
#define CPUMEASUR_SECTION "cpumeasur"
#define CPUMEASUR_PARAMS_DESC { \
{"max_cpumeasur", "Max number of cpu measur entries", 0, uptr:&max_cpumeasur, defintval:100, TYPE_UINT, 0},\
}
void
init_meas
(
void
);
int
register_meas
(
char
*
name
,
time_stats_t
*
ts
);
#endif //ifndef PHYSIM
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment