| Title: | DECmcc user notes file. Does not replace IPMT. |
| Notice: | Use IPMT for problems. Newsletter location in note 6187 |
| Moderator: | TAEC::BEROUD |
| Created: | Mon Aug 21 1989 |
| Last Modified: | Wed Jun 04 1997 |
| Last Successful Update: | Fri Jun 06 1997 |
| Number of topics: | 6497 |
| Total number of notes: | 27359 |
Hi,
I'm working with a customer whose developing various Access modules
, Event sinks and other modules. He has asked me for some help in the
development area which I don't fully understand. can anyone help with
the following ? :-
"In the Performance handling part of the NMS I have to construct an ILV
encoded structure from a performance measurement report which is
received in a similar way to an event. This report can be as long as a
piece of string ! When you create an ILV encoded structure you have to
provide a block of memory for the descriptor to point to, this is used
by the ILV encoding routines to store the ILV structure until you have
finished with it. In this case I am formatting an event which will be
put to the Event Manager when it is encoded.
When I do the mcc_ilv_put_param_begin, I do not know how many items
there are in the performance measurement report that has been received
and thus do not know how much memory to allocate for the ILV structure.
If the block that I have malloc'ed is not large enough then the
mcc_ilv_put_fail will fail with MCC_S_ILVTOOBIG. It does not seem
possible to backtrack at this point and realloc the block to be larger,
and then redo the failed mcc_ilv_put.
Is there any way of checking to see the current size of an ILV
structure ? mcc_ilv_length is no good as this requires the structure to
be ended. Also, the mcc_w_curlen field of the descriptor doesn't help.
Is the only way round this problem to make sure that I know how big the
buffer will need to be before I start the ILV puts ?
Is there any way of calculating how much space an ILV structure will
require if you know how many mcc_ilv_put's will be done ?
Also, when may I free the alloc'ed memory ? May it be free'd as soon as
the mcc_event_put has completed, or must it be kept until the Event
Manager has finished with the event? "
Thanks for any help/advice you can give. FYI, it's ULTRIX 4.2 on a
DECstation 5000-200, 48 MB memory.
Regards,
Euan
| T.R | Title | User | Personal Name | Date | Lines |
|---|---|---|---|---|---|
| 3803.1 | Dynamic Descriptors | MOLAR::ROBERTS | Keith Roberts - Network Management Applications | Fri Sep 25 1992 09:57 | 48 |
Euan,
The ILV routines support Dynamic Descriptors. This allows you to specify
and initial size (guess) as to how much space you'll need. If you exceed
this, the ILV routines will automatically expand the buffer for you -
up to a maximum buffer size of 32k bytes.
Once you have done the Event Put - you may deallocate your buffers.
Dynamic Descriptors will be better documented in the v1.2 SRM
/keith
----------------------------------------------------------------------------
To use a Dynamic Descriptor:
MCC_T_CVR status;
MCC_T_Descriptor temp_dx;
MCC_T_Unsigned32 buf_len = { 512 };
:
temp_dx.mcc_w_maxstrlen = 0;
temp_dx.mcc_w_curlen = 0;
temp_dx.mcc_b_dtype = 0;
temp_dx.mcc_b_flags = 0;
temp_dx.mcc_b_ver = MCC_K_VER_DESCRIPTOR;
temp_dx.mcc_b_class = DSC_K_CLASS_D;
temp_dx.mcc_a_pointer = MCC_K_NULL_PTR;
temp_dx.mcc_a_link = MCC_K_NULL_PTR;
status = lib$sget1_dd( &buf_len, &temp_dx );
if (status & 1)
status = MCC_S_NORMAL;
}
if _GOOD(status) {
:
<<< ILV & Event Put Code >>>
:
}
if (temp_dx.mcc_a_pointer)
lib$sfree1_dd( &temp_dx );
| |||||
| 3803.2 | You can also start with 32K | TAEC::LAVILLAT | Mon Sep 28 1992 05:21 | 19 | |
Re .0 & .1: > > The ILV routines support Dynamic Descriptors. This allows you to specify > and initial size (guess) as to how much space you'll need. If you exceed > this, the ILV routines will automatically expand the buffer for you - > up to a maximum buffer size of 32k bytes. > So, reading this, another (stupid ?) solution is starting with a 32K buffer, which will be big enough for sure ! When you run on Ultrix with 3 Megs images, 32K is peanuts... Regards. Pierre. | |||||
| 3803.3 | but we've got an elephant to feed ... 8) | MOLAR::ROBERTS | Keith Roberts - Network Management Applications | Mon Sep 28 1992 09:41 | 17 |
RE: .2 >> When you run on Ultrix with 3 Megs images, 32K is peanuts... Pierre, 32k may be peanuts .. but we've got an elephant to feed ... 8) Any way a Management Module can trim the fat on memory usage is very important. A single over-eating MM - called hundreds of times via Alarm Rules, Notifications, Historian & Exporter can quickly starve to death on 3 Megs of memory. Using Dynamic Descriptors can make your program more efficient and easier to code. The v1.2 SRM better explains their use. /keith | |||||
| 3803.4 | Yes | TAEC::LAVILLAT | Mon Sep 28 1992 10:45 | 11 | |
Re .3: Keith, You are right. I would not recommend doing this in general, but sometimes it can help... Pierre. | |||||