When the debugger is on, this predicate causes a trace line to be displayed for the current innermost box, with Port being the name of the port, and all other information being the current box's ones.
p :-
trace_parent_port(clause1),
writeln(hello),
fail.
p :-
trace_parent_port(clause2),
writeln(world).
?- p.
(1) 1 CALL p %> creep
(1) 1 CLAUSE1 p %> creep
S (2) 2 CALL writeln(hello) %> creep
hello
S (2) 2 EXIT writeln(hello) %> creep
(3) 2 CALL fail %> creep
(3) 2 FAIL fail %> creep
(1) 1 NEXT p %> creep
(1) 1 CLAUSE2 p %> creep
S (4) 2 CALL writeln(world) %> creep
world
S (4) 2 EXIT writeln(world) %> creep
(1) 1 EXIT p %> creep
Yes (0.00s cpu)