History log of /external/devlib/devlib/utils/misc.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
fef7c16b42d379936b0fbf9126b8355b7a3220ac 23-Feb-2017 Sergei Trofimov <sergei.trofimov@arm.com> utils/misc: allow modules in walk_modules input

Previsously, the import path passed to walk_modules must have been
pointing to a package. This update allows the path to point to a single
module.
/external/devlib/devlib/utils/misc.py
1dd69501778a78ecc8c5fe36de5255fe40598de2 23-Feb-2017 Sergei Trofimov <sergei.trofimov@arm.com> utils/misc: attach exc_info on error in walk_modules

Commit 28891a82 made it easier to debug issues during walk_modules by
attaching the specific name of the module being loaded to the exception.
However, the error may not originite in the imported module, but one of
the modules that module itself is importing.

To further facilitate debugging, exc_info (which contains the traceback)
for the orginal ImportError is now also attached to the raised
HostError.
/external/devlib/devlib/utils/misc.py
28891a822b48f92179e5421d70d2f1c86551f652 08-Feb-2017 Sergei Trofimov <sergei.trofimov@arm.com> utils/misc: walk_modules always raises HostError

Previously, if an error had occured while attempting to load a module
during walk_modules, it was propagated to the loading code. This
meant that walk_modules could, in theory, raise any exception at all,
and that it was not always possible to tell exactly where the exception
originated.

Now, all encounted errors are re-raised as HostError, which preserves
the original exception in an attribute and sets "modpath" attribute to
point to the module that originated it.
/external/devlib/devlib/utils/misc.py
a9265031ba01c3ac7c4fab9fdc921a617d6e2e79 08-Feb-2017 Sergei Trofimov <sergei.trofimov@arm.com> TimeoutError: moved to devlib.exception

Moved TimeoutError from devlib.util.misc to devlib.exception. It was
previously defined in misc because it needed to be there when the code
was part of WA in order to prevent an import cycle. This is not
necessary in devlib, so it is moved to be with the other exception
definitions.
/external/devlib/devlib/utils/misc.py
5d492ca957190bb38c82df5150d4d6be5bd1b173 29-Nov-2016 Sergei Trofimov <sergei.trofimov@arm.com> utils/misc: Adding Kryo cores to CPU part map

Adding part IDs of Qualcomm Kryo Gold and Silver cores to the CPU part
map.
/external/devlib/devlib/utils/misc.py
cae239d1dc1d379c3acdec081583a56bf5392313 06-Oct-2016 Sergei Trofimov <sergei.trofimov@arm.com> memoized: detect hashability by catching TypeError

This is a fix for

https://github.com/ARM-software/devlib/issues/60

Apprently, being an instance of Hashable does not mean that the object
is, in fact, hashable. So rather than testing for hashability, try to
hash the object and handle the potential error by falling back to the
old method.
/external/devlib/devlib/utils/misc.py
09ec88e9467e8c1569a095898fd089967f0ca52b 04-Oct-2016 Sergei Trofimov <sergei.trofimov@arm.com> memoized: further fixes; hash objects whre possible

This is further to commit 6d854fd4dc59936142fff811e575cd034a308c43

Due to the way certain objects are handled, getting the frist few bytes
of an object may not be enough (e.g. strings do not store their values
inline). To further mitigate the issue, hash the object where possible.
/external/devlib/devlib/utils/misc.py
08b36e71cbb6b58e40e8f13abd84bf1ba14911df 06-Sep-2016 Sergei Trofimov <sergei.trofimov@arm.com> utils; adding more CPU part numbers
/external/devlib/devlib/utils/misc.py
6d854fd4dc59936142fff811e575cd034a308c43 06-Sep-2016 Sergei Trofimov <sergei.trofimov@arm.com> memoized: fix for bug where wrong cached results were returned

memoized() used id() to get "unique" representations for arguments
passed to a function, in order to ensure that results for the same
function called with different arguments are treated differently.

However, Python object identities are only guaranteed to be unique at a
particular point in time. It is possible than a particular ID gets
reused for a different object if the previous object associated with
that ID no longer exists. In particular, in CPython, the IDs are just
addresses of the corresponding PyObject's in memory. If a PyObject gets
garbage collected, another object may get allocated in its place, and
the new object will "inherit" the ID by virtue of being in the same
memory location. If the new object is then used to call a memoized
function that was previously called with the old object, the old cached
result will be incorrectly returned.

To get around this issue, the cache is now indexed not only by the ID of
an object but also but the first few bytes of its value.

NOTE: there is still a potential issue it two relatively large objects
gets allocated in the same place and happen to share the first few
(currently 32) bytes, and are then both used as parameters to the same
memoized function. The only way around that is to hash the entire value
of the object. However, given the performance penalty that would incur
for larger object, and the unlikeliness of this situation actually
arising, it is currently deemed not worth it.
/external/devlib/devlib/utils/misc.py
d7aac2b5df29ad8bed5cac22aa9c7b590835cfcf 02-Sep-2016 Sergei Trofimov <sergei.trofimov@arm.com> utils: added a function to reset memoized cache

Added a function to reset the memo cache used by memoized decorator,
which would force all memoized functions to re-evalued their results
when they are next called. This is primarily intended for debugging.
/external/devlib/devlib/utils/misc.py
539e9b34b9329d7ad4b4ceaf962b3e0360e1089a 22-Jun-2016 Michele Di Giorgio <michele.digiorgio@arm.com> devlib/utils/misc: improve memoize decorator

Using the wrapt module we can improve the memoize decorator. In fact, it allows
to preserve the attributes of the memoized function, such as signature,
docstring, path to the file where the function is implemented, and so on.

Signed-off-by: Michele Di Giorgio <michele.digiorgio@arm.com>
/external/devlib/devlib/utils/misc.py
4e6afe960b0540a0e9781bdfbd82352ff157d248 09-Oct-2015 Sergei Trofimov <sergei.trofimov@arm.com> devlib initial commit.
/external/devlib/devlib/utils/misc.py