Commit Graph

37 Commits

Author SHA1 Message Date
Carsten Haitzler b01b219017 efreetd - log the cache runs and when they launch, show data, exit 2020-07-24 23:02:16 +01:00
Carsten Haitzler b376c2a902 efreet - look in /usr/local/share/pixmaps too 2020-04-16 13:04:03 +01:00
Vincent Torri 8db978aa4c include evil_private.h in last files, and disable symbolic links on Windows in a couple of files
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8933
2019-05-22 07:59:05 -04:00
Carsten Haitzler fceb86c865 efreetd cache - fix leak of strbuf when error conditions abort save
fix CID 1374951
2017-07-23 18:11:26 +09:00
Carsten Haitzler 91878f72f1 efreetd cache - handle queue case leaking strbuf
fix CID 1374954
2017-07-23 18:09:39 +09:00
Bryce Harrington a7c1edc44f efreet: Fix failure to save list data to output
Summary:
This fixes a typo in the fix 55676b33, which introduced an invalid early
return from the save_list function, preventing it from outputing the
list data to the file.

@fix CID1375005, CID1375004

Reviewers: jpeg

Reviewed By: jpeg

Subscribers: stefan_schmidt, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4873
2017-05-12 11:08:30 +02:00
Stefan Schmidt 55676b335c efreet: free the allocated buffer before returning
This fixes the commit 169a08c03a (efreetd:
BSD optimizations). Coverity rightly pointed out six different leaks of
various buffers on error paths.

CID: 1374949 1374950 1374951 1374952 1374953 1374954
2017-05-11 09:34:53 +02:00
Al Poole 169a08c03a efreetd: BSD optimizations.
Summary: Related to ticket T5475.

Reviewers: raster, cedric

Subscribers: jpeg, cedric, raster

Differential Revision: https://phab.enlightenment.org/D4865

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-05-10 12:26:08 -07:00
Carsten Haitzler d9ad9b585a efreetd - make efreetd use eio and not ecore_file_monitor for monitoring
this should fix T5130 - freebsd's efreetd polling regularly

@fix
2017-04-23 21:17:40 +09:00
Carsten Haitzler 0ea4d0d821 efreetd cache - use eina home env get to centralize homedir fetching
this cleans up and improves a getenv that should really use eina
2017-02-09 18:38:28 +09:00
Carsten Haitzler 561f8eaa8f efreet - save about 240-300k or so of memory used by efreet mime
so efreet mime was loading a bunch of mime type info files, parsing
them on startup and allocating memory to store all this mime info -
globs, mimetype strings and more. all a big waste of memory as its
allocated on the heap per process where its the SAME data files loaded
every time.

so make an efreet mime cache file and a tool to create it from mime
files. mmap this file with all the hashes/strings in it so all that
data is mmaped once in memory and shared between all processes and it
is only paged in on demand - as actually read/needed so if your
process doesnt need to know about mime stuff.. it wont touch it anyway.

this saves about 240-300k or so of memory in my tests. this has not
covered the mime MAGIC files which still consume memory and are on the
heap. this is more complex so it will take more time to come up with a
nice file format for the data that is nicely mmaped etc.

@optimize
2016-08-23 12:04:06 +09:00
Mike Blumenkrantz 50ab1a0e55 Revert "efreetd - reduce memory usage by using stringshare much more"
partially reverts e4d815dc48

this caused efreetd to crash almost immediately due to non-stringshared
strings being used in a stringshare-only hash data descriptor
2016-05-02 21:03:14 -04:00
Carsten Haitzler e4d815dc48 efreetd - reduce memory usage by using stringshare much more
lots of long paths for monitoring file paths for icons etc. are in
memory for efreetd. this reduces that memory by sharing them much more.

@optimization
2016-04-23 23:07:48 +09:00
Carsten Haitzler 5028a88077 efreet: fix tmp file/dir/log handling to not leave a mess and work
so efreets tmp file/cache/log file handling was broken, using
filenames in tmp and renaming them to a caceh dir that can be on
different filesystems. also log file should have been in a tmp dir ...
and subsidrs cache didnt get renamed properly at all and thus not
updated.

@fix
2016-04-08 12:13:42 +09:00
Mike Blumenkrantz 06bb13e2f8 efreetd: send ipc for EFREET_EVENT_DESKTOP_CACHE_BUILD...always
since the conversion from dbus -> ecore-ipc, efreetd has failed to
notify when a cache build has completed, instead only sending the current
state of the desktop cache: not built

fix T2733

@fix
2015-12-23 13:40:48 -05:00
Carsten Haitzler 7236343701 fix efreetd to scan more subdirs for desktop and icon files
we miss desktop files for apps and stuff because we dont monitor too
deep a tree. this ups our tree depth to 10 levels.

@fix
2015-12-02 20:53:27 +09:00
Carsten Haitzler 5263e61585 efreet desktop tracking - fix monitoring of dirs of custom desktops
@fix

this is wrong - start monitoring every/any dir in which a desktop file
exists that we load a desktop file from. imagine you browse directories
in efm with lots of desktop files in them - we end up monitoring lots
of directories that we then rememebr and don't un-monitor. this
disables monitoring of dirs from which we load a .desktop file from to
fix this.
2015-12-02 20:53:27 +09:00
Carsten Haitzler bd7ccd45b6 efreet - fix efreetd to not exit on $home being in extra app dirs
if a client added $home in the efreet extra desktops dirs, then
efreetd would detect and nuke cache, exit, causing a restart cycle
forever. this makes efreet simply ignore the errant dir so it can keep
working.

@fix
2015-11-02 10:11:53 +09:00
Vincent Torri cb83f1477f efreet: use eina_file_mkstemp() for portability and fix a bug on Windows
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-10-19 14:48:49 -07:00
Carsten Haitzler 5abfefe99e efl - efreetd service move from dbus session bus to ecore ipc
this fixes warnings about no efreet dbus session bus in non session
environments as brought up on the mailing lists with:

Subject: Re: [E-devel] [EGIT] [core/efl] master 01/01: edje: unset
efreet cache update flag to prevent dbus connections

this moves all of efreetd client and server to ecore ipc, with client
auto-launching efreetd if not found as a service and trying for up to
500ms to connect. efreetd times out on last connection or no
connections after 10sec so it wont hang around forever if not in use.
it seems to work in my testing, so let me know if there is an issue.

@fix
2015-06-24 19:28:17 +09:00
Carsten Haitzler 34bb3bb9a5 efreetd - cache - mark cd as const as it isnt needing a free on return 2015-04-14 13:52:37 +09:00
Chris Michael 4b950b55c0 efreetd: If we fail to allocate space for subdir_cache, then get out
Summary: Fix coverity CID1294212 (potential Null pointer dereference) as
the alloc for subdir_cache Could fail, however if it does we Were
still trying to use it. In the case that it fails, ERR msg and return.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2015-04-13 20:29:53 -04:00
Carsten Haitzler 701504c7a4 efreed cache - fix coverity warning on rm cleanup on sanity check
sanity check didnt check return value of ecore_file_recursive_rm(). do
that. coverity should be happy now.
2015-04-13 09:47:24 +09:00
Carsten Haitzler e05eb13f70 efreetd - fix loading of extra_icons.dirs and icon.exts to not lose char
efreetd was losing the last char on every line of extra_icon.dirs and
icon.exts thus resulting in gradual degredation of these files as more
and more changes happen to have things like:

.jpeg
.jpe
.jp
.j
.

etc. for extension or dirs like

/home/raster/.e/e/icons
/home/raster/.e/e/icon
/home/raster/.e/e/ico
...
/home/ras
/home/ra
/home/r
...
/ho
/h
/

.. you get the idea. before long the list of extra icon dirs (and
extensions) was massigve and caued all sorts of filesystem rummaging.
this fixes that to no longer degrade these files. this also changes
their names to force new files to be used instead of the broken old
ones.
2015-04-13 09:45:29 +09:00
Carsten Haitzler cd2b3c228d efreetd - startup slowness fix for recursing directories
this fixes major slowness in things like enlightenment login. when
enlightenment starts, efreetd is started. efreetd takes a long time to
start because it is scanning lots of directories recursively. it is
early in code freeze, so i think this can go in as a fix, even though
it is more of an optimization, but as such it has a fairly major speed
impact, so i consider this fixing a core performance problem for
things like logging in. The solution is a cache file containing all
the sub directories in a directory tree. we still have to stat every
directory, but this avoids a lot of stating of all files as well and
avoids any readirs etc. so it is much faster. on an ssd this comes out
to 4 times faster for efreetd to start up. on an hdd it's about 2x
faster to start uncached.

this should bea good fix for startup times - on my systems thats a 1
second speedup on ssd (out of about 8 seconds boot time) and 3 seconds
on hdd (out of about 39 seconds boot). so w save 1 and 3 seconds
respecively in boot + login.

now can we get this to 0 or close? that's a matter of designing
something like a deferred scan + monitor add so we wait until "startup
is done" then set up in the bg for a bit. that might shave another 3
seconds off boot time for hdd's but for ssd's wil barely blip (maybe
save 0.1 sec). so leave that till normal dev mode.

@fix
2015-04-13 09:09:42 +09:00
Carsten Haitzler 44fe8b987e efreetd - improve sanity checking for recursive icon monitoring
i found my efreetd was not just monitoring a small set of dirs but
literally $HOME - recursively. this explains a lot of performance
issues i have seen on spinning hdd's vs ssd's. i never knew if was in
efreetd though... until now. for whatever reason my efret cache caused
efreet to try monitro a list like:

/
/h
/ho
/hom
/home
/home/
/home/r
... etc.

when trying to monitor something like:

/home/raster/.local/share/icons

that means it ended up trying $HOME as wellas a vast range of dirs it
just shouldn't sensibly ever try. i have no idea how my cache ended up
this way, but deleting it and re-populating it fixed it. so this ads
code to detect such insanity (as wellas give actual complaints on deep
recursion so we can see things better later). not a bug fix as such,
but a major improvement to detecting bugs which is what we want for
stability.

I also noticed that one legacy pixmaps dir is not recursively
monitored, but another is - so be consistent and recurs both.

Also apply checks to desktop file monitoring too.
2015-04-12 12:19:41 +09:00
Mike Blumenkrantz 668fcab941 efreetd: temporarily blacklist saving and monitoring root directory
ref T2280
2015-04-09 20:08:17 -04:00
Carsten Haitzler 1551268280 efreetd - cache - fix handling a text index file with 0 length lines
this fixes an efreetd cache crash where files like icon.exts might
have lines with just a newline and no extension/content on the line.

@fix
2015-04-01 20:44:57 +09:00
Carsten Haitzler 931d02378b efreet - fix recusrion checks need to pop as well as push.
stable release - cherry-pick me!

this fixes a lack of popping the efret recursion stack handler. this
wasn't done in 1.8 and is a bug.
2013-12-05 20:04:25 +09:00
Carsten Haitzler f6f28bf75a efreet - protect efreetd from recursing too far to save overhead and mem
an errant path made its way into my efreet cache. this had a
side-effect of causing efreetd to scan my entire $HOME recursively
to monitor everything. while the original cause was $HOME getting in,
we shouldn't have efreetd sit and consume scan all of $HOME when this
is far from a normal situation. the recursive scanning is there ot
handle some minimal levels of subdirs in app directories, but not an
entire filesystem, so this mitigates the effects of errant cache data
by limiting the amount of recursion allows for icon dirs and desktop
dirs to 8 and 3 levels respectively.
2013-12-04 20:25:57 +09:00
Sebastian Dransfeld 70474a4bc5 efreet: Create stack at start of recursion
No need to check for NULL stack, we know where we start our recursive
scan, so create the stack there.

Also fixes CID1132751 and CID1132752
2013-12-04 09:12:31 +01:00
Carsten Haitzler c69cf48746 recursive monitoring and scanning fix for icons and desktop files
this fixes T580 ... or SHOULD fix it. there is recursion detection
code now and it properly follows symlinks and dirs. it also properly
updates the file monitor tree for both icons and desktops and it only
monitors dirs, not files (as a dir picks up changes to child data).
tested and it seems not to recurse into self-referencing symlinks
(once it detects the loop) and detects changes nicely in all my tests.
2013-11-27 19:50:24 +09:00
Sebastian Dransfeld ebcd97cc93 efreet: Create cache dir in efreet_cache_init
efreetd used efreet functions before efreet init which fails.
2013-06-21 10:00:20 +02:00
Sebastian Dransfeld 58fc3a8f32 efreet: Low priority for cache rebuild 2013-06-20 13:53:54 +02:00
Lucas De Marchi 483a80be8a efl/efreet: move efreet_{icon,desktop}_cache_create under MODULE_ARCH
These binaries are called by efreetd and should be under MODULE_ARCH
dir.

And actually fix the path to efreet_desktop_cache_create that was wrong.



SVN revision: 82489
2013-01-09 22:31:59 +00:00
Gustavo Sverzut Barbieri 1eddf87965 efl/efreet: use eina_prefix, kill one TODO item.
SVN revision: 82219
2013-01-04 17:42:23 +00:00
Gustavo Sverzut Barbieri 4bc0210bd3 efl: merge efreet.
seems to be fine, pass distcheck and friends. please report.

changes:
 - documentation hierarchy fixes
 - replaced __UNUSED__ with EINA_UNUSED
 - replaced PKG_DATA_DIR with PACKAGE_DATA_DIR"/efreet"



SVN revision: 81889
2012-12-29 23:04:40 +00:00