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
83
Issues
83
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
bf543eb7
Commit
bf543eb7
authored
Feb 09, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel/wr_pstats: change name portX to wrportX+1
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
13f94d9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
6 deletions
+10
-6
wr_pstats.c
kernel/wr_pstats/wr_pstats.c
+4
-3
wrs_pstats.c
userspace/tools/wrs_pstats.c
+6
-3
No files found.
kernel/wr_pstats/wr_pstats.c
View file @
bf543eb7
...
...
@@ -43,9 +43,10 @@ static unsigned int firmware_adr_pp; /* number of words with counters */
static
unsigned
int
firmware_cpw
;
/* number of counters per word */
module_param
(
pstats_nports
,
int
,
S_IRUGO
);
const
char
*
portnames
[]
=
{
"port0"
,
"port1"
,
"port2"
,
"port3"
,
"port4"
,
"port5"
,
"port6"
,
"port7"
,
"port8"
,
"port9"
,
"port10"
,
"port11"
,
"port12"
,
"port13"
,
"port14"
,
"port15"
,
"port16"
,
"port17"
};
const
char
*
portnames
[]
=
{
"wrport1"
,
"wrport2"
,
"wrport3"
,
"wrport4"
,
"wrport5"
,
"wrport6"
,
"wrport7"
,
"wrport8"
,
"wrport9"
,
"wrport10"
,
"wrport11"
,
"wrport12"
,
"wrport13"
,
"wrport14"
,
"wrport15"
,
"wrport16"
,
"wrport17"
,
"wrport18"
};
static
struct
pstats_version_description
pstats_desc
[]
=
{
[
0
]
=
{
...
...
userspace/tools/wrs_pstats.c
View file @
bf543eb7
...
...
@@ -96,7 +96,8 @@ static void parse_sysfs(int init)
if
(
init
==
1
)
{
for
(
port
=
0
;
port
<
use_ports
;
++
port
)
{
sprintf
(
filename
,
"/proc/sys/pstats/port%u"
,
port
);
sprintf
(
filename
,
"/proc/sys/pstats/wrport%u"
,
port
+
1
);
file
=
fopen
(
filename
,
"r"
);
for
(
cntr
=
0
;
cntr
<
CNT_PP
;
++
cntr
)
{
fscanf
(
file
,
"%"
SCNu32
,
&
tmp1
);
...
...
@@ -110,13 +111,15 @@ static void parse_sysfs(int init)
else
{
for
(
port
=
0
;
port
<
use_ports
;
++
port
)
{
sprintf
(
filename
,
"/proc/sys/pstats/port%u"
,
port
);
sprintf
(
filename
,
"/proc/sys/pstats/wrport%u"
,
port
+
1
);
file
=
fopen
(
filename
,
"r"
);
for
(
cntr
=
0
;
cntr
<
CNT_PP
;
++
cntr
)
{
fscanf
(
file
,
"%"
SCNu32
,
&
tmp1
);
fscanf
(
file
,
"%"
SCNu32
,
&
tmp2
);
val
=
(((
uint64_t
)
tmp2
)
<<
32
)
|
tmp1
;
cnt_pp
[
port
][
cntr
].
cnt
=
val
-
cnt_pp
[
port
][
cntr
].
init
;
cnt_pp
[
port
][
cntr
].
cnt
=
val
-
cnt_pp
[
port
][
cntr
].
init
;
}
fclose
(
file
);
}
...
...
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