Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
White Rabbit Switch - Software
Commits
6ea11623
Commit
6ea11623
authored
Jul 24, 2013
by
Maciej Lipinski
Committed by
Grzegorz Daniluk
May 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
re-done this useful application, cleaned, added option, added counters
parent
3b6f1732
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
24 deletions
+39
-24
wrsw_pstats.c
userspace/tools/wrsw_pstats.c
+39
-24
No files found.
userspace/tools/wrsw_pstats.c
View file @
6ea11623
...
...
@@ -55,23 +55,23 @@ char info[][20] = {{"Tu-run|"}, // 0
{
"Tframe|"
},
// 18
{
"Rframe|"
},
// 19
{
"Rrtu_f|"
},
// 20
{
"R
TUreq|"
},
// 21
{
"R
TUrsp|"
},
// 22
{
"R
TUdrp|"
},
// 23
{
"R
TUhp |"
},
// 24
{
"R
TUf-f|"
},
// 25
{
"R
TUn-f|"
},
// 26
{
"R
TUfst|"
},
// 27
{
"R
TUful|"
},
// 28
{
"RTU
fwd|"
},
// 29 ---
{
"R
pri_0|"
},
// 30 -> p
0
{
"R
pri_1|"
},
// 31 -> p
1
{
"R
pri_2|"
},
// 32 -> p
2
{
"R
pri_3|"
},
// 33 -> p
3
{
"R
pri_4|"
},
// 34 -> p
4
{
"R
pri_5|"
},
// 35 -> p
5
{
"R
pri_6|"
},
// 36 -> p
6
{
"R
pri_7|"
}
// 37 -> p7
{
"R
pri_0|"
},
// 21 -> p0
{
"R
pri_1|"
},
// 22 -> p1
{
"R
pri_2|"
},
// 23 -> p2
{
"R
pri_3|"
},
// 24 -> p3
{
"R
pri_4|"
},
// 25 -> p4
{
"R
pri_5|"
},
// 26 -> p5
{
"R
pri_6|"
},
// 27 -> p6
{
"R
pri_7|"
},
// 28 -> p7
{
"RTU
req|"
},
// 29
{
"R
TUrsp|"
},
// 3
0
{
"R
TUdrp|"
},
// 3
1
{
"R
TUhp |"
},
// 3
2
{
"R
TUf-f|"
},
// 3
3
{
"R
TUn-f|"
},
// 3
4
{
"R
TUfst|"
},
// 3
5
{
"R
TUful|"
},
// 3
6
{
"R
TUfwd|"
}
// 37 ---
};
static
void
read_cntval
(
int
port
,
int
adr
,
uint32_t
*
data
);
...
...
@@ -158,8 +158,6 @@ void print_chosen_cnts( int cnts_list[], int n_cnts)
int
cnt
=
0
;
int
port
=
0
;
printf
(
" --------Printing priority counters-----------
\n\n
"
);
printf
(
"P |"
);
for
(
cnt
=
0
;
cnt
<
n_cnts
;
++
cnt
)
printf
(
"%2d:%s"
,
cnts_list
[
cnt
],
info
[
cnts_list
[
cnt
]]);
...
...
@@ -181,19 +179,27 @@ void print_info(char *prgname)
{
printf
(
"usage: %s <command> [<values>]
\n
"
,
prgname
);
printf
(
""
" -h Show this message
\n
"
" -p Show counters for priorities
\n
"
);
" Show >default< counters (no argument, counters which seem most useful and feeting on a wide screen)
\n
"
" -r Show counters from RTU
\n
"
" -e Show counters from Endpoints
\n
"
" -p Show counters for priorities only (from Endpoints)
\n
"
" -a Show all counters (don't fit screen)
\n
"
" -h Show this message
\n
"
);
}
int
main
(
int
argc
,
char
**
argv
)
{
time_t
last_show
=
0
;
int
option
=
0
;
int
prio_cnts
[]
=
{
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
};
int
prio_cnts
[]
=
{
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
};
//8
int
def_cnts
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
};
//30
int
rtu_cnts
[]
=
{
29
,
30
,
31
,
32
,
33
,
34
,
35
,
36
,
37
};
//9
int
ep_cnts
[]
=
{
0
,
1
,
2
,
3
,
4
,
5
,
6
,
7
,
8
,
9
,
10
,
11
,
12
,
13
,
14
,
15
,
16
,
17
,
18
,
19
,
20
,
21
,
22
,
23
,
24
,
25
,
26
,
27
,
28
};
//29
int
op
=
0
;
if
(
pstats_init
())
return
-
1
;
op
=
getopt
(
argc
,
argv
,
"ph"
);
op
=
getopt
(
argc
,
argv
,
"ph
era
"
);
while
(
1
)
{
...
...
@@ -204,6 +210,15 @@ int main(int argc, char **argv)
case
'p'
:
print_chosen_cnts
(
prio_cnts
,
8
);
break
;
case
'e'
:
print_chosen_cnts
(
ep_cnts
,
29
);
break
;
case
'r'
:
print_chosen_cnts
(
rtu_cnts
,
9
);
break
;
case
'a'
:
print_first_n_cnts
(
CNT_PP
);
break
;
case
'h'
:
default:
print_info
(
argv
[
0
]);
...
...
@@ -211,7 +226,7 @@ int main(int argc, char **argv)
break
;
}
else
print_
first_n_cnts
(
30
);
print_
chosen_cnts
(
def_cnts
,
30
);
parse_sysfs
(
0
);
sleep
(
1
);
...
...
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