Skip to content

Commit 5e75ea1

Browse files
committed
remove trace system
1 parent 4acf324 commit 5e75ea1

File tree

12 files changed

+10
-752
lines changed

12 files changed

+10
-752
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
- improve display of computed multipage images
1111
- batch mode output is lazy
1212
- ++, join_sep, difference are lazy
13+
- removed trace system
1314

1415
## 9.0.13 2025/09/20
1516

TODO

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
- remove trace stuff from reduce
2-
3-
also remove prefs workspace stuff?
1+
- remove remove prefs workspace stuff?
42

53
things like max heap size should be settable ... maybe pres are useful?
64

src/action.c

Lines changed: 4 additions & 125 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,14 +1593,6 @@ void
15931593
action_proc_construct(Reduce *rc,
15941594
Compile *compile, HeapNode **arg, PElement *out)
15951595
{
1596-
if (trace_flags & TRACE_CLASS_NEW) {
1597-
VipsBuf *buf = trace_push();
1598-
1599-
vips_buf_appendf(buf, "constructor \"%s\" ",
1600-
IOBJECT(compile->sym)->name);
1601-
trace_args(arg, compile->nparam + compile->nsecret);
1602-
}
1603-
16041596
if (reduce_safe_pointer(rc,
16051597
(reduce_safe_pointer_fn) action_proc_construct_sub,
16061598
compile, arg, out, NULL))
@@ -1614,11 +1606,6 @@ action_proc_construct(Reduce *rc,
16141606
printf("reduce: invoking arg checker\n");
16151607
#endif
16161608
}
1617-
1618-
if (trace_flags & TRACE_CLASS_NEW) {
1619-
trace_result(TRACE_CLASS_NEW, out);
1620-
trace_pop();
1621-
}
16221609
}
16231610

16241611
static void *
@@ -1647,24 +1634,8 @@ static void
16471634
action_proc_class_binary(Reduce *rc, Compile *compile,
16481635
int op, const char *name, PElement *a, PElement *b, PElement *out)
16491636
{
1650-
TraceFlags flags = op >= 0 ? TRACE_OPERATOR : TRACE_BUILTIN;
16511637
PElement fn;
16521638

1653-
if (trace_flags & flags) {
1654-
VipsBuf *buf = trace_push();
1655-
1656-
vips_buf_appendf(buf, "%s\n", _("invoking method:"));
1657-
vips_buf_appends(buf, " ");
1658-
trace_pelement(a);
1659-
vips_buf_appendf(buf, ".%s \"%s\" ", MEMBER_OO_BINARY, name);
1660-
trace_pelement(b);
1661-
vips_buf_appends(buf, "\n");
1662-
1663-
trace_text(flags, "%s", vips_buf_all(buf));
1664-
1665-
trace_pop();
1666-
}
1667-
16681639
/* Look up a.oo_binary and build (a.dispatch_binary "add" b)
16691640
* application.
16701641
*/
@@ -1683,24 +1654,8 @@ static void
16831654
action_proc_class_binary2(Reduce *rc, Compile *compile,
16841655
int op, const char *name, PElement *a, PElement *b, PElement *out)
16851656
{
1686-
TraceFlags flags = op >= 0 ? TRACE_OPERATOR : TRACE_BUILTIN;
16871657
PElement fn;
16881658

1689-
if (trace_flags & flags) {
1690-
VipsBuf *buf = trace_push();
1691-
1692-
vips_buf_appendf(buf, "%s\n", _("invoking method:"));
1693-
vips_buf_appends(buf, " ");
1694-
trace_pelement(b);
1695-
vips_buf_appendf(buf, ".%s \"%s\" ", MEMBER_OO_BINARY2, name);
1696-
trace_pelement(a);
1697-
vips_buf_appends(buf, "\n");
1698-
1699-
trace_text(flags, "%s", vips_buf_all(buf));
1700-
1701-
trace_pop();
1702-
}
1703-
17041659
/* Look up b.dispatch_binary2 and build
17051660
* (b.dispatch_binary2 "add" a) application.
17061661
*/
@@ -1724,63 +1679,34 @@ action_landlor(Reduce *rc, Compile *compile,
17241679
*/
17251680
return;
17261681

1727-
if (trace_flags & TRACE_OPERATOR)
1728-
trace_push();
1729-
17301682
/* Examine the LHS and see if we can avoid RHS eval.
17311683
*/
17321684
if (PEISCLASS(a))
17331685
action_proc_class_binary(rc, compile, op, name, a, b, out);
17341686
else if (PEISBOOL(a)) {
1735-
if (op == BI_LOR && PEGETBOOL(a)) {
1736-
if (trace_flags & TRACE_OPERATOR)
1737-
trace_binop(compile, a, op, b);
1738-
1687+
if (op == BI_LOR && PEGETBOOL(a))
17391688
PEPUTP(out, ELEMENT_BOOL, TRUE);
1740-
1741-
if (trace_flags & TRACE_OPERATOR)
1742-
trace_result(TRACE_OPERATOR, out);
1743-
}
1744-
else if (op == BI_LAND && !PEGETBOOL(a)) {
1745-
if (trace_flags & TRACE_OPERATOR)
1746-
trace_binop(compile, a, op, b);
1747-
1689+
else if (op == BI_LAND && !PEGETBOOL(a))
17481690
PEPUTP(out, ELEMENT_BOOL, FALSE);
1749-
1750-
if (trace_flags & TRACE_OPERATOR)
1751-
trace_result(TRACE_OPERATOR, out);
1752-
}
17531691
else {
17541692
/* Need to look at RHS too.
17551693
*/
17561694
reduce_spine(rc, b);
17571695

17581696
if (PEISCOMB(b) && PEGETCOMB(b) != COMB_I) {
1759-
if (trace_flags & TRACE_OPERATOR)
1760-
trace_pop();
17611697
return;
17621698
}
17631699

17641700
if (PEISCLASS(b))
17651701
action_proc_class_binary2(rc, compile, op, name, a, b, out);
1766-
else if (PEISBOOL(b)) {
1767-
if (trace_flags & TRACE_OPERATOR)
1768-
trace_binop(compile, a, op, b);
1769-
1702+
else if (PEISBOOL(b))
17701703
PEPUTP(out, ELEMENT_BOOL, PEGETBOOL(b));
1771-
1772-
if (trace_flags & TRACE_OPERATOR)
1773-
trace_result(TRACE_OPERATOR, out);
1774-
}
17751704
else
17761705
action_boperror(rc, compile, NULL, op, name, a, b);
17771706
}
17781707
}
17791708
else
17801709
action_boperror(rc, compile, NULL, op, name, a, b);
1781-
1782-
if (trace_flags & TRACE_OPERATOR)
1783-
trace_pop();
17841710
}
17851711

17861712
static void
@@ -1800,40 +1726,20 @@ action_if(Reduce *rc, Compile *compile,
18001726
PElement t, e;
18011727

18021728
/* a is condition, b should be [then-part, else-part] ...
1803-
* look down b and find them. Block trace for this, not very
1804-
* interesting.
1729+
* look down b and find them.
18051730
*/
1806-
trace_block();
18071731
reduce_list_index(rc, b, 0, &t);
18081732
reduce_list_index(rc, b, 1, &e);
1809-
trace_unblock();
18101733

18111734
/* Can be BOOL or image.
18121735
*/
18131736
if (PEISBOOL(a)) {
1814-
if (trace_flags & TRACE_OPERATOR) {
1815-
VipsBuf *buf = trace_push();
1816-
1817-
vips_buf_appendf(buf, "if ");
1818-
trace_pelement(a);
1819-
vips_buf_appendf(buf, " then ");
1820-
trace_pelement(&t);
1821-
vips_buf_appendf(buf, " else ");
1822-
trace_pelement(&e);
1823-
vips_buf_appendf(buf, " ->\n");
1824-
}
1825-
18261737
if (PEGETBOOL(a)) {
18271738
PEPUTPE(out, &t);
18281739
}
18291740
else {
18301741
PEPUTPE(out, &e);
18311742
}
1832-
1833-
if (trace_flags & TRACE_OPERATOR) {
1834-
trace_result(TRACE_OPERATOR, out);
1835-
trace_pop();
1836-
}
18371743
}
18381744
else if (PEISIMAGE(a)) {
18391745
reduce_spine_strict(rc, &t);
@@ -2025,22 +1931,8 @@ static void
20251931
action_proc_class_unary(Reduce *rc, Compile *compile,
20261932
int op, const char *name, PElement *a, PElement *out)
20271933
{
2028-
TraceFlags flags = op >= 0 ? TRACE_OPERATOR : TRACE_BUILTIN;
20291934
PElement fn;
20301935

2031-
if (trace_flags & flags) {
2032-
VipsBuf *buf = trace_push();
2033-
2034-
vips_buf_appendf(buf, "%s\n", _("invoking method:"));
2035-
vips_buf_appends(buf, " ");
2036-
trace_pelement(a);
2037-
vips_buf_appendf(buf, ".%s \"%s\"\n", MEMBER_OO_UNARY, name);
2038-
2039-
trace_text(flags, "%s", vips_buf_all(buf));
2040-
2041-
trace_pop();
2042-
}
2043-
20441936
/* Look up a.dispatch_unary and build
20451937
* (a.oo_unary "minus") application.
20461938
*/
@@ -2062,7 +1954,6 @@ action_dispatch(Reduce *rc, Compile *compile, ReduceFunction rfn,
20621954
int op, const char *name, gboolean override,
20631955
ActionFn afn, int nargs, HeapNode **arg, void *user)
20641956
{
2065-
TraceFlags flags = op >= 0 ? TRACE_OPERATOR : TRACE_BUILTIN;
20661957
PElement a, b;
20671958
int i;
20681959

@@ -2093,13 +1984,6 @@ action_dispatch(Reduce *rc, Compile *compile, ReduceFunction rfn,
20931984
PEPOINTRIGHT(arg[0], &b);
20941985
PEPOINTRIGHT(arg[1], &a);
20951986

2096-
if (trace_flags & flags) {
2097-
VipsBuf *buf = trace_push();
2098-
2099-
vips_buf_appendf(buf, "\"%s\" ", name);
2100-
trace_args(arg, nargs);
2101-
}
2102-
21031987
if (override && nargs == 2 && PEISCLASS(&a))
21041988
action_proc_class_binary(rc, compile, op, name, &a, &b, &b);
21051989
else if (override && nargs == 2 && PEISCLASS(&b))
@@ -2110,9 +1994,4 @@ action_dispatch(Reduce *rc, Compile *compile, ReduceFunction rfn,
21101994
afn(rc, compile, op, name, arg, &b, user);
21111995

21121996
PPUTLEFT(arg[0], ELEMENT_COMB, COMB_I);
2113-
2114-
if (trace_flags & flags) {
2115-
trace_result(flags, &b);
2116-
trace_pop();
2117-
}
21181997
}

src/itext.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ itext_decompile_element(VipsBuf *buf, PElement *base, gboolean top)
283283
else if (PEISTAG(base))
284284
vips_buf_appends(buf, PEGETTAG(base));
285285
else
286-
graph_pelement(rc->heap, buf, base, TRACE_FUNCTIONS);
286+
graph_pelement(rc->heap, buf, base, FALSE);
287287

288288
return TRUE;
289289
}

src/meson.build

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ sources = files(
146146
'toolkitgroupview.c',
147147
'toolkitview.c',
148148
'toolview.c',
149-
'trace.c',
150149
'tree.c',
151150
'tslider.c',
152151
'util.c',

src/nip4.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@
134134
*/
135135
#define MAX_ERROR_FRAG (100)
136136

137-
/* Biggest thing we print in trace.
138-
*/
139-
#define MAX_TRACE (1024)
140-
141137
/* Max chars we display of value.
142138
*/
143139
#define MAX_LINELENGTH (120)
@@ -282,7 +278,6 @@ typedef struct _Workspace Workspace;
282278
#include "iregion.h"
283279
#include "iarrow.h"
284280
#include "log.h"
285-
#include "trace.h"
286281
#include "row.h"
287282
#include "matrix.h"
288283
#include "rhs.h"

0 commit comments

Comments
 (0)