This repository was archived by the owner on Aug 5, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 62
Merge 'serialization_api' into master #299
Closed
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
dawagner
commented
Oct 27, 2015
-
General Comment
- <img border=0 src='https://avatars.githubusercontent.com/u/6862950?v=3' height=16 width=16'> 👎 until Element handle #300 is merged (and the tests fore-coming)
- <img border=0 src='https://avatars.githubusercontent.com/u/6430928?v=3' height=16 width=16'> needs to be done by hand.
Returns element type formatted as XML. Change-Id: Id75e04882fea62e47a3e0277fb4ec70d7220917a Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Louis Le Gall <louis.le.gall@intel.com>
This patch allows additional distinction in the displaying of pending configurations: - if there's no applicable configuration the pending configuration will be shown as "<none>"; - if the applicable configuration is same as currently applied one, it will be displayed as an empty string "". Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
Merge 'master' into 'serialization_api'
This method returns a reference to the vector of all the arguments passed along the remote command. Signed-off-by: Miguel Gaio <miguel.gaio@intel.com>
CParameterBlackboard class now exposes the following additional methods to direclty access the blackboard memory a certain offset: - writeBytes() - readBytes() Note that these methods are primarily intended to be used to access the settings of an element. Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Miguel Gaio <miguel.gaio@intel.com>
Returns the element settings formatted as hexadecimal byte array Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Miguel Gaio <miguel.gaio@intel.com>
Allows assigning settings to a configurable element in byte array format. Supports hexa or decimal formatting. Notes: - Use with caution (low level command): checks for integrity are not performed prior to assignment. - Tuning Mode must be on Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Miguel Gaio <miguel.gaio@intel.com>
Access elements as binary Add support to inport/export configurable element in binary format.
The recently-introduced methods readBytes() and writeBytes() where using a uint32_t for the 'offset' argument whereas all other methods use a size_t. This is inconsistent and also will trigger a conversion warning with -Wconversion. Signed-off-by: David Wagner <david.wagner@intel.com>
Fix type inconsistencies in ParameterBlakcboard API The recently-introduced methods readBytes() and writeBytes() where using a uint32_t for the 'offset' argument whereas all other methods use a size_t. This is inconsistent and also will trigger a conversion warning with -Wconversion.
The problem: Inital values of virtual susbsystem parameters in the blackboard may be incorrect with respect to their type defintion. This may lead to situations where it's impossible to import settings which were previously exported. The reason: Backward synchronization process occuring at start time ensures a proper initialization of the blackboard by collecting all the syncers and triggering a back synchronization on them. Only, the syncer set collection was not properly implemented in Virtual Subsystem, meaning that its syncer was not collected. This patch ensures that the virtual subsystem syncer (called virtual syncer) gets properly collected when filling the syncer set at ConfigurableElement ancestor class level, by implementing the fillSyncerSetFromDescendant() virtual method at its level. Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
Virtual syncer: use default value instead of 0
Up to now, Xml exporting feature in CElement relied on the CElement::getKind() method to get the XML element tag. However, some CElement derived classes might need to reflect in XML as a type which differs from their kind (which is class name related). This patch uncouples the notion of element kind from the tag used to import/export an element in XML. Then it makes use of this functionality each time an XML element is created based on the element XML type. Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com>
The file test/functional-tests-legacy/xml/TestConfigurableDomains.xml is not used. This patch removes it. Signed-off-by: Thomas Cahuzac <thomasx.cahuzac@intel.com>
This patch covers the following requirements: - Ensure that when the parameter structure is exported in XML (via tuning interface or C++ API), Component tag is replaced with ParameterBlock, so that the resulting instance structure gets usable for Subsystem instance definition - When exporting settings in XML, be they domains or configurable elements (getAsXML via tuning interface or C++ API), the Component tag is replaced with ParameterBlock so that exported structure and settings are consistent - Retro-compatibility will be performed in a subsequent patch. Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Thomas Cahuzac <thomasx.cahuzac@intel.com>
"Component" tag has been renamed to "ParameterBlock", but existing settings files with "Component" tag shall remain compatible. This patch introduces the retro-compatibility code. Signed-off-by: Thomas Cahuzac <thomasx.cahuzac@intel.com>
…er_block Rename component tag to parameter block Export instantiated Components as `<ParameterBlock>` and support retro-compatibility for previously-exported files.
`ConfigurableElements` can be imported/exported in two view: the structure and settings view. In order to make this more obvious. Do not use a generic name (`fromXml`) for one and a specific name (`getSettingsAsXML`) for the other. Rename the structure export from `fromXml` to `structureFromXml`. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com> Signed-off-by: François Gaffie <francois.gaffie@intel.com>
`setValue` and `getValues` were taking a base offset parameter whereas `doSetValue` and `doGetValue` were taking an offset. Homogenize both function and make it possible to forward the offset from one function to the other by changing `[sg]etValues` to take an offset. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Calling base implementation of serializeXmlSettings() method from ArrayParameter was causing the update of the XML node by Base parameter, that is, the scalar implementation. This patch ensures only the array implementation of the serializeXmlSettings() is solicited. This is achieved by a proper overloading of the doGetValue() and doSetValue() virtual methods called from the base implementation in BaseParameter. Note: this issue was first introduced by the attempt of reusing base code during XML export to take advantage of Name attribute handling. See patch "Make XML export settings reusable for any configurable element". Change-Id: If535ca4c4b608cf7a85ab2a90121e2ea64d00820 Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
In order to serialize and deserialize parameters, values need to be formated. To do that an CParameterAccessContext is used by the parameters. During a serialization, a CParameterAccessContext was constructed from XmlParameterSerializerContext. As a result, CParameterAccessContext members were duplicated in XmlParameterSerializerContext. To avoid that, XmlParameterSerializerContext now contain a CParameterAccessContext. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com> Signed-off-by: François Gaffie <francois.gaffie@intel.com>
Get command returns current element values (from main blackboard) in XML format. Set command Allows assigning a configurable element's settings directly in XML. Notes: - Tuning mode must be on - In case of failure, all the subelements that have been successfully written along the access keep their new value Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
In order to help debuging test-platform unexpected stops, add its return code in the error message on such event. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Add get and set element xml commands Get command returns current element values (from main blackboard) in XML format. Set command allows assigning a configurable element's settings directly in XML. Notes: - Tuning mode must be on - In case of failure, all the subelements that have been successfully written along the access keep their new value
CConfigurableElement::isRogue() method was only suitable for parameters, not for elements. If an element did not belong to any domain, but one of its descendent did, this method would have mistakenly returned true. This error was not detected up to now for this method was only used with parameters (leaf elements in parameter tree). Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Handles have non const method, thus their reference on PF elements should not be const. It used to work because the only method called `access` was const even when setting a value. Give a non const value to ParameterHandle constructor. It will be used in a future Handle that will call non const methods. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
mayFailCall is a function that takes a method and arguments and calls the method, transforming the error code in exception. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
👎 until #300 is merged (and the tests fore-coming) |
Add a static_assert to detect incorrect method usage. Without it, an error would still occur but might be harder to debug. Use a human readable error message instead. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Extract a `getSettingsAsBytes` and `setSettingsAsBytes` method from the corresponding remote command handling. This permits to access elements a bytes from a c++ interface without duplicating the code. Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
This patch pulls the mapping functionality up by one class: it is now available as part of CConfigurableElement interface. CConfigurableElementWithMapping is no more necessary so it's been removed. This patchs allows accessing he mapping functionalities from a configurable element without the need to know its actual nature (instance configurable element or subsystem). Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
CElementHandle can be used by applications to directly control an element part of the parameter tree. CElementHandle objects can be created by calling the platform connector class new createElementHandle() functionality. Element handle objects are owned by the application so it's its responsibility to destroy them through a "delete" operation. The following functionalities are available in CElementHandle class: - getting element's name - getting element's path in parameter hierarchy tree - getting element's memory size in bytes - determining if element is rogue - getting the structure of the element (expanded version of the structure) - getting/setting the element's settings in XML format - getting/setting the element's settings in binary format Notes: - setting the element's settings in binary shall be done cautiously: no check is made as to the data integrity, meaning the operation could result in inconsistent parameter states where some parameter values are out of range or invalid wrt their type - setting the element's settings will fail if the element is not rogue (belong to a domain or one of its descendent does) - if a tuning application has set the auto sync mode to off, the changes applied through CElementHandle will be forward-synchronized when the auto sync mode is set back to on or when the "sync" remote command is executed. - when the tuning mode is on, calls to setAsXML() and setAsBytes() will fail silently (do nothing but return true meaning success) Signed-off-by: Patrick Benavoli <patrick.benavoli@intel.com> Signed-off-by: Kevin Rocard <kevin.rocard@intel.com>
Element handle CElementHandle can be used by applications to directly control an element part of the parameter tree. CElementHandle objects can be created by calling the platform connector class new createElementHandle() functionality.
needs to be done by hand. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.