summaryrefslogtreecommitdiffstats
path: root/firmware/logf.c
AgeCommit message (Collapse)AuthorFilesLines
2017-11-21Implement a much more capable vuprintf()Michael Sevakis1-6/+6
New support as well as some buggy support fixed. Still no floating point support if ever that would be desired. Support (*): * Flags: '-', '+', ' ', '#', '0' * Width and precision: 'n', '.n', '*' and '.*' * Length modifiers: 'hh', 'h', 'j', 'l', 'll', 't', 'z' * Radix: 'c', 'd', 'i', 'n', 'o', 'p/P', 's', 'u', 'x/X' (*) Provision exists to switch lesser-used stuff on or off or when certain functionality isn't desired (bootloader?). The compulsory radixes are everything but 'o', 'n', 'p/P' and 'x/X' with length modifiers being optional. The default setup is 'l', 'z', 'c', 'd', 'p/P', 's', 'u', 'x/X'. * Move fdprintf() to its own file. It was in a strange place. * Make callers compatible and fix a couple snprintf() bugs while at it. Could smush it down in size but I'm gonna get over the binsize neurosis and just the let optimizer do its thing. Change-Id: Ibdc613a9b6775802c188b29b9dd46c568c94f7c3
2016-04-04Don't add new message to logf when we dump it to fileMihail Zenkov1-0/+4
Fix log file corruption if we have new messages at dumping log to file. Comment removed as it incorrect. We store all messages in direct order (last message at end of file). Change-Id: I4acfa8a0935cc41a889e08f6bc42974fefd1ade2
2015-01-11Make a few local variables staticThomas Jarosch1-1/+1
Change-Id: Ieb77a7f2cdf765afa3121320d03c0478cd97eb0f
2014-12-20Add missing va_end() call when the log is fullThomas Jarosch1-0/+1
No need to go out of memory, too ;) cppcheck reported: [rockbox/firmware/logf.c:338]: (error) va_list 'ap' was opened but not closed by va_end(). Change-Id: I00e4c04d7e3d5d1415aa5066487ce1d9209e53aa
2014-03-14events: Rework event subsystem (add_event, send_event) to be more versatile.Thomas Martitz1-3/+2
add_event_ex is added that takes an extra user_data pointer. This pointer is passed to the callback (add_event and add_event_ex have slightly different callbacks types). All callbacks also get the event id passed. Events added with add_event_ex must be removed with remove_event_ex because the user_data pointer must match in addition to the callback pointer. On the other add_event is simplified to omit the oneshort parameter which was almost always false (still there with add_event_ex). As a side effect the ata_idle_notify callbacks are changed as well, they do not take a data parameter anymore which was always NULL anyway. This commit also adds some documentation to events.h Change-Id: I13e29a0f88ef908f175b376d83550f9e0231f772
2014-01-11Print `last logf lines on panic().Frank Gevaerts1-0/+49
If logf is enabled, panic() will print the last lines. On small screens this is more or less useless, but on large screens it can be very useful for debugging. Change-Id: I26dfc76e9ac4a2ddc2def8db1616a04f943dbba3 Reviewed-on: http://gerrit.rockbox.org/709 Reviewed-by: Thomas Martitz <kugel@rockbox.org> Reviewed-by: Frank Gevaerts <frank@gevaerts.be> Tested: Frank Gevaerts <frank@gevaerts.be>
2013-08-16Fix logdiskAmaury Pouly1-6/+4
The code was broken in a subtle but crucial way: storage idle callbacks are oneshot so after the first flush everything would stay in the buffer forever and would never be written to the disk thus resulting into many events being lost. This changed correctly registers the idle callback each time the buffer is not empty. Note that the idle storage code checks if a callback has is in the queue already so we don't register twice. Change-Id: Ifdf331d4b757e05b8a6902bf5926cbc7689f5109
2012-08-06Remove copy/pasted preprocessor defines that shouldn't have been included.Michael Giacomelli1-2/+1
Also, add dummy defines for application targets so that ERRORF, etc map to DEBUGF instead of a compile error and add a new line at the end of logf.c. Change-Id: Ie7c5bc3397a853af619e810defce6123114e7a51
2012-08-07Introduce logging to disk feature into rockbox.Michael Giacomelli1-26/+103
Logs information, errors, etc to disk using the register_storage_idle_func mechanism to write to the disk when available. Currently, this is disabled in normal builds, but can be enabled by adding ROCKBOX_HAS_LOGDISKF to the config file. By default, it uses a 2KB buffer and drops text if the buffer overflows. The system includes a simple warning level mechanism that can be used to by default exclude non-serious errors from logging on release builds. Change-Id: I0a3d186a93625c7c93dae37b993a0d37e5a3a925 Reviewed-on: http://gerrit.rockbox.org/288 Reviewed-by: Jonathan Gordon <rockbox@jdgordon.info> Tested-by: Michael Giacomelli <mgiacomelli@gmail.com> Reviewed-by: Michael Giacomelli <mgiacomelli@gmail.com>
2012-02-16Make logf() output to serial optionalRalf Ertzinger1-2/+2
Only output logf() to the serial port if LOGF_SERIAL is defined (in addition to HAVE_SERIAL). Add an option to advanced configure to set this (defaults to off). Change-Id: I13d0f5df391e5371f7797f46a3faaf7a6974b9e4 Reviewed-on: http://gerrit.rockbox.org/92 Reviewed-by: Björn Stenberg <bjorn@haxx.se>
2012-01-07Only use lcd-remote.h #ifdef HAVE_REMOTE_LCDRafaël Carré1-0/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31613 a1c6a512-1295-4272-9138-f99709370657
2010-08-02Fix a logf bug which would trigger undefined behaviour(and probably crash) ↵Amaury Pouly1-0/+3
when both DEBUG, CONFIG_PLATFORM & PLATFORM_HOSTED are enable git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27663 a1c6a512-1295-4272-9138-f99709370657
2010-06-21Rockbox as an application: Replace many occurences of #ifdef SIMULATOR with ↵Thomas Martitz1-1/+1
#if (CONFIG_PLATFORM & PLATFORM_HOSTED) (or equivalently). The simulator defines PLATFORM_HOSTED, as RaaA will do (RaaA will not define SIMULATOR). The new define is to (de-)select code to compile on hosted platforms generally. Should be no functional change to targets or the simulator. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27019 a1c6a512-1295-4272-9138-f99709370657
2010-05-15vuprintf does not belong in stdio.h, causes problems with other versions of ↵Jeffrey Goode1-0/+1
stdio.h git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26042 a1c6a512-1295-4272-9138-f99709370657
2010-05-06Revert r25854 which was bad for the database tool (I forgot it still needs ↵Thomas Martitz1-3/+2
the wrappers from uisimulator/common/io.c). Fix it so it works for both. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25856 a1c6a512-1295-4272-9138-f99709370657
2009-11-03Rename vfnprintf to vuprintf (u stands for user for the user callback and ↵Thomas Martitz1-1/+1
data passed to it) to avoid confusion with file and buffer size related functions from the printf-family, and add a comment to its declaration. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23503 a1c6a512-1295-4272-9138-f99709370657
2009-11-02Echoes logf output to the sim console when logf build is enabledJeffrey Goode1-0/+7
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23485 a1c6a512-1295-4272-9138-f99709370657
2009-08-21A new implementation of logf, logfdisplay and logfdump.Maurus Cuelenaere1-74/+138
Flyspray: FS#10528 Author: Amaury Pouly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22462 a1c6a512-1295-4272-9138-f99709370657
2009-08-12Fix a wrong memcpy in logf() introduced in r22253Rafaël Carré1-1/+1
Flyspray: FS#10515 Author: Amaury Pouly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22276 a1c6a512-1295-4272-9138-f99709370657
2009-08-11Fix logf() multilines handlingRafaël Carré1-4/+5
Each line (of MAX_LOGF_ENTRY characters) would be marked with LOGF_TERMINATE_CONTINUE_LINE, but still be padded with a '\0' This also reverts r22250 which worked around the problem in logfdump() Flyspray: FS#10513 Author: Amaury Pouly git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22253 a1c6a512-1295-4272-9138-f99709370657
2009-07-14FS#10080Nils Wallménius1-1/+1
* Move strncpy() from core to the pluginlib * Introduce strlcpy() and use that instead in most places (use memcpy in a few) in core and some plugins * Drop strncpy() from the codec api as no codec used it * Bump codec and plugin api versions git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21863 a1c6a512-1295-4272-9138-f99709370657
2009-05-23Reorganise USB stack defines. Now config.h decides which class drivers get ↵Frank Gevaerts1-1/+1
enabled instead of usb_core.h Also enable HID, and use that as the dummy class instead of charging-only for controllers that have working interrupt transfers. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21053 a1c6a512-1295-4272-9138-f99709370657
2009-03-11Commit FS#9970 by Yoshihisa Uchida: fix building when HAVE_SERIAL & ↵Maurus Cuelenaere1-1/+1
ROCKBOX_HAS_LOGF is defined in a simulator build git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20291 a1c6a512-1295-4272-9138-f99709370657
2009-02-07Fix building of tools/database/Frank Gevaerts1-9/+9
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19940 a1c6a512-1295-4272-9138-f99709370657
2009-01-01Fix (USB) serial logf()Maurus Cuelenaere1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19634 a1c6a512-1295-4272-9138-f99709370657
2008-12-31Fix off-by-oneMaurus Cuelenaere1-3/+3
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19626 a1c6a512-1295-4272-9138-f99709370657
2008-12-31Commit FS#9733 (multiline logf) by Yoshihisa UchidaMaurus Cuelenaere1-10/+48
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19625 a1c6a512-1295-4272-9138-f99709370657
2008-06-28Updated our source code header to explicitly mention that we are GPL v2 orDaniel Stenberg1-2/+4
later. We still need to hunt down snippets used that are not. 1324 modified files... http://www.rockbox.org/mail/archive/rockbox-dev-archive-2008-06/0060.shtml git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17847 a1c6a512-1295-4272-9138-f99709370657
2008-06-23FS#9051 - remove LCD margins... use viewports if you need them...Jonathan Gordon1-1/+0
NOTE to WPS people.... %m has been removed, but (i think) because of the other %m tags it wont fail if you try loading a wps with %m|..|, it will just be ignored. Also note that if the statusbar is enabled the default viewport is 8 pixels shorter than when its not, i.e (0,0) is really (0,8) if the statusbar is shown... I dont think this will be a major issue because almost no WPS show the bar and use bitmaps... text only WPS shouldnt be affected. Please report problem screens in http://forums.rockbox.org/index.php?topic=17358.0 git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17763 a1c6a512-1295-4272-9138-f99709370657
2008-03-02implement logf over usb-serial. Needs USB_SERIAL defined in usb_core.h to ↵Frank Gevaerts1-0/+10
work, and needs to be enabled in the debug menu. It stops sending data after a while for unknown reasons. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16486 a1c6a512-1295-4272-9138-f99709370657
2006-11-10Support building tagcache db natively on PC using the core of theMiika Pekkarinen1-2/+15
Rockbox tagcache database engine. Only host endian support at the moment and no command line parameters. Mainly for developers for debugging at the moment. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11497 a1c6a512-1295-4272-9138-f99709370657
2006-10-12Logf output on the serial port for h100 targetsLinus Nielsen Feltzing1-0/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11207 a1c6a512-1295-4272-9138-f99709370657
2005-06-30better logfMichiel Van Der Kolk1-4/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6949 a1c6a512-1295-4272-9138-f99709370657
2005-06-22Moved to logf.hTomas Salfischberger1-1/+0
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6808 a1c6a512-1295-4272-9138-f99709370657
2005-06-01Modified logf to use a define for the log width, and changed it to default toDaniel Stenberg1-12/+12
21 as that is what fits in an iriver LCD by default since the font is 6 pixels wide. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6547 a1c6a512-1295-4272-9138-f99709370657
2005-05-30(Optional) logf supportDaniel Stenberg1-0/+5
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6538 a1c6a512-1295-4272-9138-f99709370657
2005-05-24use proper remote lcd functionsDaniel Stenberg1-2/+2
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6522 a1c6a512-1295-4272-9138-f99709370657
2005-05-24initial remote-LCD logf browserDaniel Stenberg1-3/+40
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6520 a1c6a512-1295-4272-9138-f99709370657
2005-05-24Uses indices instead of pointersLinus Nielsen Feltzing1-8/+9
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6517 a1c6a512-1295-4272-9138-f99709370657
2005-05-23initial logf() work, not added to SOURCES yet (on purpose)Daniel Stenberg1-0/+60
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6514 a1c6a512-1295-4272-9138-f99709370657