Re: [EE] Saving "printf" arguments for later? Real-time on slow processor.
Neil <[email protected]>
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <[email protected]> |
Seems like I missed some of the posts in this thread and don't know what processors/eco-system this is, but just from the comments here... Couldn't you replace the printf library with your own? Yes you'd also have to replace other functions in that library that your code uses. On 1/20/2025 9:58 AM, Jason White wrote: > 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. >> -- http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at https://mailman.mit.edu/mailman/listinfo/piclist