Bug #396

OMF and OML disagree on data types

Added by Olivier Mehani over 1 year ago. Updated over 1 year ago.

Status:Closed Start date:07/09/2010
Priority:High Due date:08/09/2010
Assignee:Jolyon White % Done:

100%

Category:tools
Target version:2.4.0 Estimated time:1.00 hour

Description

I'm using OMF-5.3 and OML-2.4.

I have an app file describing my application, which I feed to oml2_scaffold to generate the required headers.

Among others, in contains this measurement point definition.

a.defMeasurement("dccp") do |m|
  m.defMetric('x_recv', :double, "Receive rate (Bps)")
  m.defMetric('rtt', :double, "RTT estimate (us)" )
  m.defMetric('p', :double, "Loss event rate")
  m.defMetric('freezestate', :int32, "Frozen state")
end

It works fine with oml2_scaffold which generates the following snippet.

static OmlMPDef oml_dccp_def[] = {
  {"x_recv", OML_DOUBLE_VALUE},
  {"rtt", OML_DOUBLE_VALUE},
  {"p", OML_DOUBLE_VALUE},
  {"freezestate", OML_INT32_VALUE},
  {NULL, (OmlValueT)0}
};

However, omf exec chokes on it saying FATAL run: Exception: (RuntimeError) Unknown type 'double' for metric 'x_recv'.

If I modify my application definition to use the old terminology (though I didn't know the :double was “new,” is it), as follows, OMF seems to be happy.

a.defMeasurement("dccp") do |m|
  m.defMetric('x_recv', :float, "Receive rate (Bps)")
  m.defMetric('rtt', :float, "RTT estimate (us)" )
  m.defMetric('p', :float, "Loss event rate")
  m.defMetric('freezestate', :integer, "Frozen state")

end

However, this breaks oml-scaffold:

static OmlMPDef oml_dccp_def[] = {
  {"x_recv", OML_UNKNOWN},
  {"rtt", OML_UNKNOWN},
  {"p", OML_UNKNOWN},
  {"freezestate", OML_UNKNOWN},
  {NULL, (OmlValueT)0}
};

Something is (urgently, IMO) needed to unify that, otherwise it appears that OML-2.4 is unusable with OMF-5.3...

Associated revisions

Revision 5e3a7124
Added by Jolyon White over 1 year ago

Fix type aliases in oml2_scaffold to help with OMF integration.

- Added back :int, :integer => :long
- Added :float, :real => :double
- Added warnings for :int, :integer -- plan to switch the alias to
:int32 in OML 2.5
- Added warning that :long is deprecated.
- Fixes #396

History

Updated by Olivier Mehani over 1 year ago

s/:integer/:int/

Updated by Jolyon White over 1 year ago

  • Category set to tools
  • Status changed from New to Assigned
  • Assignee set to Jolyon White
  • Target version set to 2.4.0
  • Estimated time set to 1.00

I checked the git log for oml2_scaffold. It has only ever supported the keyword :double; I tried to check the SVN log for OMF, and it only ever seems to have supported :float. It's not of any consequence, but the oml2_scaffold initial commit predates the OMF integration of OML by about three months, as far as I can tell. This seems to be a case of the left hand not knowing what the right hand is doing.

I also noticed that at some point I deleted the :int and :integer synonyms for the :long type in oml2_scaffold. I'll put them back in. I'd prefer to change them to be synonyms for :int32, but that would also break old code in OMF, because OMF's defMetric doesn't have any notion of OML's new integer types.

So, here's what I'll do to oml2_scaffold:

- :float, :double, :real => OML_DOUBLE_VALUE
- :int, :integer, :long => OML_LONG_VALUE
- Warning that :int, :integer will be re-targetted to OML_INT32_VALUE in future
- Switch :int, :integer => OML_INT32_VALUE in OML 2.5

Sound good?

Updated by Olivier Mehani over 1 year ago

That's sounds alright, yes.

As for the choice of using OML_LONG_VALUE or OML_INT32_VALUE, I'd
rather use the latter by default, and add a “backward compatibility”
switch to generate the previous types if needed.

But either solution should work in practice.

Updated by Jolyon White over 1 year ago

  • Due date set to 08/09/2010
  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

I've made the changes in my local repo -- I'll push to mytestbed.net when I come in to the office.

Thanks for the suggestion about a compatibility switch -- I'll implement that for OML 2.5, when I switch the alias.

Also available in: Atom PDF