Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
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
Esteban Blanc
proview
Commits
b052da9b
Commit
b052da9b
authored
May 18, 2016
by
Claes Sjofors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rt_rtt, print function added to show subsrv
parent
ffdde477
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
92 additions
and
0 deletions
+92
-0
src/lib/dtt/src/dtt_appl_rttsys_p26.dtt
src/lib/dtt/src/dtt_appl_rttsys_p26.dtt
+15
-0
src/lib/dtt/src/dtt_rttsys.c
src/lib/dtt/src/dtt_rttsys.c
+77
-0
No files found.
src/lib/dtt/src/dtt_appl_rttsys_p26.dtt
View file @
b052da9b
...
...
@@ -1647,3 +1647,18 @@ Database RTTSYS
Declaration INT
x,y 77 0
-------------------------------------------------------------------
Number 305
Text "Print"
Type SET
Parameter SHOW_SUBSRV_PRINT
Text/Dualpar ""
Privileges OP
Outputflags NO
Characters 0
Decimals 0
MaxLimit 0.000000
MinLimit 0.000000
Database RTTSYS
Declaration INT
x,y 75 1
-------------------------------------------------------------------
src/lib/dtt/src/dtt_rttsys.c
View file @
b052da9b
...
...
@@ -535,6 +535,78 @@ static int rttsys_get_nodename( pwr_tNodeId nid, char *nodename)
#endif
}
typedef
struct
{
int
subid
;
int
count
;
pwr_tNid
nid
;
pwr_tAttrRef
aref
;
}
subsrv_tData
;
void
print_subsrv
()
{
pwr_tStatus
sts
;
pool_sQlink
*
sl
;
sub_sServer
*
ssrvp
;
char
nodename
[
80
];
pwr_tAName
astr
=
""
;
int
subcnt
;
FILE
*
fp
;
subsrv_tData
*
data
;
int
i
;
pwr_tFileName
fname
=
"/tmp/subsrv.txt"
;
char
msg
[
200
];
fp
=
fopen
(
fname
,
"w"
);
if
(
!
fp
)
return
;
fprintf
(
fp
,
"%5s %5s %8s %4s %4s %s
\n
"
,
"Subid"
,
"Count"
,
"Node"
,
"Size"
,
"Offs"
,
"Object"
);
gdb_ScopeLock
{
subcnt
=
0
;
for
(
sl
=
pool_Qsucc
(
&
sts
,
gdbroot
->
pool
,
&
gdbroot
->
db
->
subs_lh
);
sl
!=
&
gdbroot
->
db
->
subs_lh
;
sl
=
pool_Qsucc
(
&
sts
,
gdbroot
->
pool
,
sl
))
{
subcnt
++
;
}
data
=
(
subsrv_tData
*
)
calloc
(
subcnt
,
sizeof
(
subsrv_tData
));
subcnt
=
0
;
for
(
sl
=
pool_Qsucc
(
&
sts
,
gdbroot
->
pool
,
&
gdbroot
->
db
->
subs_lh
);
sl
!=
&
gdbroot
->
db
->
subs_lh
;
sl
=
pool_Qsucc
(
&
sts
,
gdbroot
->
pool
,
sl
))
{
ssrvp
=
pool_Qitem
(
sl
,
sub_sServer
,
subs_ll
);
data
[
subcnt
].
nid
=
ssrvp
->
nid
;
data
[
subcnt
].
aref
=
ssrvp
->
aref
;
data
[
subcnt
].
subid
=
ssrvp
->
sid
.
rix
;
data
[
subcnt
].
count
=
ssrvp
->
count
;
subcnt
++
;
}
}
gdb_ScopeUnlock
;
for
(
i
=
0
;
i
<
subcnt
;
i
++
)
{
rttsys_get_nodename
(
data
[
i
].
nid
,
nodename
);
sts
=
gdh_AttrrefToName
(
&
data
[
i
].
aref
,
astr
,
sizeof
(
astr
),
cdh_mNName
);
if
(
EVEN
(
sts
))
cdh_ArefToString
(
astr
,
&
data
[
i
].
aref
,
1
);
fprintf
(
fp
,
"%5d %5d %8s %4d %4d %s%s
\n
"
,
data
[
i
].
subid
,
data
[
i
].
count
,
nodename
,
data
[
i
].
aref
.
Size
,
data
[
i
].
aref
.
Offset
,
data
[
i
].
aref
.
Flags
.
b
.
Indirect
?
"@"
:
""
,
astr
);
}
free
(
data
);
fclose
(
fp
);
sprintf
(
msg
,
"Subscriptions printed to %s"
,
fname
);
rtt_message
(
'I'
,
msg
);
}
int
RTTSYS_SHOW_SUBSRV
(
menu_ctx
ctx
,
int
event
,
char
*
parameter_ptr
,
...
...
@@ -624,6 +696,11 @@ int RTTSYS_SHOW_SUBSRV( menu_ctx ctx,
SHOW_SUBSRV_COUNTER
=
k
;
if
(
SHOW_SUBSRV_PRINT
)
{
print_subsrv
();
SHOW_SUBSRV_PRINT
=
0
;
}
return
RTT__SUCCESS
;
/**********************************************************
...
...
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