Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.

Jason White <[email protected]>
Newsgroups gmane.comp.hardware.microcontrollers.pic
Message-ID <CAOFvGD6C1hqb-u93JRaGaJUhW=m+Vmi-n3uqDw_k9qW_amr6DA@mail.gmail.com>
I've got roughly 10000 printf calls that would need swapped out (it's a big
library). And the library is updated frequently,

I would need to write a program to scan through the source, and change each
printf. (and really, with so many changes, I'd like to be able to undo the
changes so that I can run a "diff")

While I had hoped I could avoid parsing the string, I feel writing a
"function call transformer program" is too much work for only a small
speedup.


If you have any leads on ways to make that function swapping easier, I'm
open to it. But I think if I went through with it I would end up writing a
custom Rust program that parses all the source files in each directory,
determines the type signature, and does the swap. (comments out the old
function with a unique marker, and then places the new function with same
arguments surrounded by comment markers)


On Mon, Jan 20, 2025 at 9:34 AM Isaac Marino Bavaresco <
[email protected]> wrote:

> Is it possible for you to replace que calls to 'printf' with calls to
> different functions depending on the specific formatting?
>
> If so, each function would know exactly what it is receiving as
> parameters and simplify the saving of the data. Those functions could
> even receive an additional parameter telling them if they should save
> the parameters or printf them.
>

-- 
Jason White
-- 
http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive
View/change your membership options at
https://mailman.mit.edu/mailman/listinfo/piclist
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.