T.R | Title | User | Personal Name | Date | Lines |
---|
1046.1 | | TOOK::GUERTIN | I do this for a living -- really | Thu May 23 1991 10:33 | 15 |
| RE:.0
First of all, some of the trace bits do not work, so you should not set
all of them. Setting the MCC_EVENT_TRACE logical to 180 will trace both
Get and Put sides. This should be all you need. The others bits are for
lower level Event Manager routines, and would not make a lot of sense to
you anyway. Please post the trace logs for the Get side (and the Put side
if it isn't too much trouble). If you are getting a CVR of Invalid
Descriptor, it could be that the timestamp argument you are passing in
is not a valid "time" descriptor. Did you call mcc_time_create() to
create it? And please make sure that all descriptors passed in are by
reference (pointer to the descriptor).
Thanks,
-Matt.
|
1046.2 | what about MCC_EVENT_LOG? | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Thu May 23 1991 12:35 | 5 |
| RE: .1
How about the MCC_EVENT_LOG logical?
/N
|
1046.3 | | PHONE::ALLAIN | | Thu May 23 1991 14:20 | 8 |
| Re questions 2.
The event_data descriptor shoud be of type MMC_K_DT_ILV. Then you need to
build the event data following the instruction for ILV encoding an event report.
That way there is nothing to do after the mcc_event_get for building the event
report as it's already done...
|
1046.4 | | PHONE::ALLAIN | | Thu May 23 1991 14:30 | 52 |
| Sorry for the previous reply, this is a bit short, here is some examples...
The event_report is to be given to the mcc_event_put routine as the event_data.
I hope that helps. If you want more, just ask...
Francois
/* create a descriptor for the Event Data */
status = mcc_desframe_create_descriptor(
&(*p_context)->alloc_mem_list, /* Memory Allocation List */
&(*p_context)->event_report, /* Descriptor Pointer */
&length, /* Length */
&MCC_K_DT_ILV, /* Datatype */
0, /* Initial Value */
&MCC_K_EVENT_RECEIVED, /* Id */
0); /* VMS datatype */
/* Begin building Rpt for Event Mgr */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_begin(&ctx, (*p_context)->event_report);
/* Begin Constructor, Id = Reply-Argument Id Value */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin(&ctx, &MCC_K_ARG_EVENT_REPORT,
MCC_K_NULL_PTR, MCC_K_NULL_PTR, &mode);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin(&ctx, &event_code,
MCC_K_NULL_PTR, MCC_K_NULL_PTR, &mode);
/*************************************
Insert your data here, if you want...
*************************************/
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end(&ctx);
/* End Constructor */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end(&ctx);
/* End building attr Output */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_end(&ctx, (*p_context)->event_report);
|
1046.5 | RE:.2... $ DEFINE MCC_EVENT_LOG 1 | TOOK::GUERTIN | I do this for a living -- really | Thu May 23 1991 15:18 | 1 |
|
|
1046.6 | still probl with MCC_K_DT_ILV | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Thu May 23 1991 15:53 | 5 |
| repl .3
I've created a descriptor of type MCC_K_DT_ILV for the event-data
argument in the call to MCC_EVENT_GET but I still get the
INVALID-STRING-DESCRIPTOR status returned.
|
1046.7 | log from MCC_EVENT_GET | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Thu May 23 1991 16:00 | 61 |
| repl .1
Below you'll find the log from the GETEVENT-side. Next reply is from
the PUTEVENT-side.
I've defined MCC_EVENT_LOG to 1 and MCC_EVENT_TRACE to 180
It seems to me that the descriptor for the eventdata is invalid?
If so, how should I create it? Should I really create it if using
the out_p argument from the argumentlist to the getevent-
entrypointroutine?
/Nils
======================================================================
DECmcc (V1.1.0)
MCC> getevent mymm * any events
Tracing error paths in Event Manager
Tracing Event code path in GET
Tracing Event code path in PUT
Event_Get starting
Event_Get processing Partition argument
Event_Get Input Arguments ...
in_entity =
entity [0] wild = INSTANCE_FULL class = 700
Partition = 15
Filter = MCC_K_NULL_PTR
time_spec = MCC_K_NULL_PTR
Handle context not set up yet
Event_Get handle state = MCC_K_HANDLE_FIRST
Event_Get building a PRMB for this request
Event_Get creating a Heartbeat thread for this request
Event_Get setting the Heartbeat thread-id 1000A
Event_Get creating TimeStamps
Event_Get requesting NEXT event
Going to wait for the event now...
Event_Get was Signalled
Copying Event Data to user supplied buffers
Failed to copy Event Data Storage:
%MCC-E-INV_DESC, invalid string descriptor encountered
THUMP!
Failed to dequeue event:
%MCC-E-NOMOREVT, no more events in event queue
Get Event failed to copy event data:
%MCC-E-INV_DESC, invalid string descriptor encountered
==> After MCC_EVENT_GET call: <--- output from my AM
==> error: status = 52874802
==> call to MCC_ILV_DUMP on event_data: --
NULL
==> Call to MCC_AES_DUMP on out_entity
<--- this is the entity
sent into MCC_EVENT_PUT
entity [0] wild = NOT_WILD class = 700 id = 1717 type = 3
instance = ABCD
%MCC-E-INV_DESC, invalid string descriptor encountered
|
1046.8 | log from MCC_EVENT_PUT | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Thu May 23 1991 16:02 | 128 |
| repl .1
Below you'll find the log from the PUTEVENT-side. The funny thing about the
MCC_EVENT_PUT is that it produces different results depending on if there's
any outstanding event-requests or not.
I've defined MCC_EVENT_LOG to 1 and MCC_EVENT_TRACE to 180
First a log when there's NO request for an event and after when there
is an outstanding request (some 60 lines below...)
$ run putevent
Tracing error paths in Event Manager
Tracing Event code path in GET
Tracing Event code path in PUT
Event_Put starting
Event_Put processing Partition argument
Event_Put Input Arguments ...
entity [0] wild = NOT_WILD class = 700 id = 1717 type = 3
instance = ABCD
Partition = 15
Event Code = 771
Event Data =
Dump of MCC Descriptor reveals:
mcc_w_maxstrlen = 54460
mcc_w_curlen = 15
mcc_b_flags = 0
mcc_b_ver = 0
mcc_l_id = 2151508
mcc_a_pointer = ...............
%X000000000000000000000000000000
mcc_a_link =
mcc_w_maxstrlen = 16
mcc_b_dtype = DSC_K_DTYPE_T
mcc_b_class = DSC_K_CLASS_D
mcc_w_curlen = 16
mcc_b_flags = 0
mcc_b_ver = 1
mcc_l_id = 0
mcc_l_dt = MCC_K_DT_BIN_ABS_TIM
mcc_a_pointer = �.�.!.�.......<.
%XC091EA032119CA01FFFFFFFFFFFF3C10
mcc_a_link = MCC_K_NULL_PTR
Timestamp = 23-MAY-1991 19:41:32.38
Event_Put getting current time
Event_Put converting user supplied time into BAT
Event_Put building an EDS structure to store Event Data
Event_Put creating an AHS
Event_Put Locking Subscriber structures
Event_Put Subscriber searching for first(/next) matching request
Event_Put Subscriber Handle state = MCC_K_HANDLE_MORE
Event_Put Subscriber Locking RMBs
Event_Put Subscriber found Request marked for Delete
Event_Put Subscriber Unlocking RMBs
Event_Put Subscriber searching for first(/next) matching request
Event_Put Subscriber Handle state = MCC_K_HANDLE_FIRST
Event_Put Subscriber finished matching requests
Event_Put Unlocking Subscriber structures
Event_Put cleaning up
Failed to free descriptor in EDS:
%MCC-E-INV_DESC, invalid string descriptor encountered
Error Deleting Event Data in Event Put:
%MCC-E-INV_DESC, invalid string descriptor encountered
=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+
and now when there's an outstanding event-request
$ run putevent
Tracing error paths in Event Manager
Tracing Event code path in GET
Tracing Event code path in PUT
Event_Put starting
Event_Put processing Partition argument
Event_Put Input Arguments ...
entity [0] wild = NOT_WILD class = 700 id = 1717 type = 3
instance = ABCD
Partition = 15
Event Code = 771
Event Data =
Dump of MCC Descriptor reveals:
mcc_w_maxstrlen = 54460
mcc_w_curlen = 15
mcc_b_flags = 0
mcc_b_ver = 0
mcc_l_id = 2151508
mcc_a_pointer = ...............
%X000000000000000000000000000000
mcc_a_link =
mcc_w_maxstrlen = 16
mcc_b_dtype = DSC_K_DTYPE_T
mcc_b_class = DSC_K_CLASS_D
mcc_w_curlen = 16
mcc_b_flags = 0
mcc_b_ver = 1
mcc_l_id = 0
mcc_l_dt = MCC_K_DT_BIN_ABS_TIM
mcc_a_pointer = .s.!.�.......<.
%X00BE73902119CA01FFFFFFFFFFFF3C10
mcc_a_link = MCC_K_NULL_PTR
Timestamp = 23-MAY-1991 19:45:28.16
Event_Put getting current time
Event_Put converting user supplied time into BAT
Event_Put building an EDS structure to store Event Data
Event_Put creating an AHS
Event_Put Locking Subscriber structures
Event_Put Subscriber searching for first(/next) matching request
Event_Put Subscriber Handle state = MCC_K_HANDLE_MORE
Event_Put Subscriber Locking RMBs
Event_Put Subscriber found Request for NEXT Event
Event_Put Subscriber referencing Event Data
Event_Put Subscriber building a Event Data Queue Element
Event_Put Subscriber sending an Event to a Requestor
Event_Put Subscriber Unlocking RMBs
Event_Put Subscriber searching for first(/next) matching request
Event_Put Subscriber Handle state = MCC_K_HANDLE_FIRST
Event_Put Subscriber finished matching requests
Event_Put Unlocking Subscriber structures
Event_Put cleaning up
|
1046.9 | Wrong side... | PHONE::ALLAIN | | Thu May 23 1991 16:27 | 8 |
| reply .6
What I was describing in the notes .3 and .4 is the putevent side. You
build the right event_data on the putevent side and then on the getevent side,
you just need to call mcc_event_get with p_callargs->p_out_p as the event_data
argument, and every thing shoud be OK.
Francois
|
1046.10 | Try setting the mcc_b_ver field to 1 | TOOK::GUERTIN | I do this for a living -- really | Thu May 23 1991 16:46 | 3 |
| MCC descriptor have a version number of 1.
-Matt.
|
1046.11 | a_link is null? | TOOK::CALLANDER | | Thu May 23 1991 16:52 | 0 |
1046.12 | Another bad field in the descriptor | TOOK::GUERTIN | I do this for a living -- really | Thu May 23 1991 16:56 | 2 |
| Good point Jill. The mcc_a_link field should be set to MCC_K_NULL_PTR.
-Matt.
|
1046.13 | How I do it | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Fri May 24 1991 05:32 | 126 |
| repl .4
That's how I've done it (I think...) and I still don't get it to work.
I must be missing something obvious. I'm attaching the PUTEVENT-program
hoping for some clarification.
/Nils
+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
#include ... /* necessary includefiles */
main ()
{
unsigned long int status = MCC_S_NORMAL ;
unsigned long int *alloc_mem_list = MCC_K_NULL_PTR ;
unsigned long mode = MCC_K_ILV_NATIVE_VALUE ;
unsigned long int systime[2];
MCC_T_Descriptor *time_stamp = MCC_K_NULL_PTR ;
MCC_T_Descriptor *instance = MCC_K_NULL_PTR ;
MCC_T_Descriptor *event_report = MCC_K_NULL_PTR ;
MCC_T_Descriptor *arg_desc = MCC_K_NULL_PTR ;
MCC_A_AES entity = MCC_K_NULL_PTR ;
MCC_T_UNSLONG event_partition = MCC_K_PRT_CONFIGURATION_EVENTS;
MCC_T_UNSLONG event_code = MCC_K_MYMM_TESTEVENT_SYMBOL ;
char entity_name[] = "ABCD" ;
char event_data[] = "JUST AN EVENT-REPORT" ;
unsigned short int length ;
unsigned short int eventlength = 128 ;
struct MCC_R_ILV_CONTEXT ctx ;
/* init mem mgmt service */
status = mcc_desframe_init_alloc_list( &alloc_mem_list );
/* create fake entity */
length = strlen(entity_name);
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor(
&alloc_mem_list, &instance, &length,
&MCC_K_DT_LATIN1STRING, &entity_name,
&1717, MCC_K_NULL_PTR);
if(status == MCC_S_NORMAL)
status = mcc_aes_create( &entity, &MCC_K_CLASS_MYMM,
instance, &MCC_K_AES_NOT_WILD);
/* create event report */
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor(
&alloc_mem_list, &event_report,
&eventlength, &MCC_K_DT_ILV,
0, &MCC_K_MYMM_EVENT_RECEIVED, 0);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_begin( &ctx, event_report);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin( &ctx, &MCC_K_MYMM_EVENT_REPORT,
MCC_K_NULL_PTR, MCC_K_NULL_PTR,
&mode);
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_begin( &ctx, &event_code,
MCC_K_NULL_PTR, MCC_K_NULL_PTR,
&mode);
/*
** create descriptor for event_data
** and insert it into event_report
*/
length = strlen(event_data);
if(status == MCC_S_NORMAL)
status = mcc_desframe_create_descriptor(
&alloc_mem_list, /* Memory Allocation List */
&arg_desc, /* Descriptor Pointer */
&length, /* Length */
&MCC_K_DT_LATIN1STRING, /* Datatype */
&event_data, /* Initial Value */
&1, /* Id */
&DSC_K_DTYPE_T); /* VMS datatype */
if(status == MCC_S_NORMAL)
status = mcc_ilv_put( &ctx, arg_desc, MCC_K_NULL_PTR );
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end( &ctx );
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_cons_end( &ctx );
if(status == MCC_S_NORMAL)
status = mcc_ilv_put_param_end( &ctx, event_report );
/*
** create timestamp with current time
*/
status = sys$gettim(systime);
status = mcc_time_create(&time_stamp, &MCC_K_DT_UNSIGNED64, 0, systime);
/*
** dump event-data
*/
if(status == MCC_S_NORMAL)
mcc_ilv_dump( event_report );
/*
** deliver event...
*/
if(status == MCC_S_NORMAL)
status = mcc_event_put( entity,
&event_partition,
&event_code,
&event_report,
time_stamp);
if (status == MCC_S_NORMAL)
printf (" ===> PUTEVENT; Successful completion!\n");
else if (status == MCC_S_NOEVENTREQ)
printf (" ===> PUTEVENT; no event request outstanding!\n");
else
printf (" ===> PUTEVENT; error! status = %d\n", status);
sys$exit( status );
} /* main */
|
1046.14 | what a difference a '&' can make! | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Fri May 24 1991 06:19 | 11 |
| Why do it right when it can be done the wrong way.....?
I've declared event_report as a POINTER to MCC_T_Descriptor and
as that it should be passed to MCC_EVENT_PUT; not as an ADDRESS to a
pointer to a MCC_T_Descriptor. So now I got that part to work.
Thanks everyone for the help. Now I've only the rest to do....
/Nils
|
1046.15 | Please do not use VMS routines, such as sys$getim | NANOVX::ROBERTS | Keith Roberts - DECmcc Toolkit Team | Fri May 24 1991 09:53 | 35 |
| RE: .13
In your coding example I *strongly* suggest that you do not use any VMS
system calls - ie:
status = sys$gettim(systime);
status = mcc_time_create(&time_stamp, &MCC_K_DT_UNSIGNED64, 0, systime);
Instead, you should use 'mcc_time_get_current' ...
----------------------------------------------------------------------------
MCC_T_CVR status;
MCC_T_UNSLONG binary_abs_time = MCC_K_DT_BIN_ABS_TIM;
MCC_T_Descriptor *p_time_stamp;
status = mcc_time_create(
&p_time_stamp, /* Pointer to Time Stamp Descriptor */
&binary_abs_time, /* Binary Absolute Time Datatype */
MCC_K_NULL_PTR, /* Initial Time Length: n/a */
MCC_K_NULL_PTR ); /* Initial Time Value: n/a */
status = mcc_time_get_current(
p_time_stamp ); /* Address of Time Stamp Descriptor */
----------------------------------------------------------------------------
!!! and don't forget to delete the descriptor when your done with it:
status = mcc_time_delete(
&p_time_stamp );
Keith Roberts
DECmcc Toolkit
|
1046.16 | more problems... | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Fri May 24 1991 11:56 | 32 |
| RE: .15
I'll change the codepart with sys$gettim. /Thanks
Now to another thing:
When I do a "GETEVENT myMYMM ANY EVENTS" and at the putevent-side I
create an entity instance = ABCD, class=MYMM, id=1, type=4
everything works fine at the EVENT_GET-side but if I do a
"GETEVENT MYMM ABCD ANY EVENTS" and the same thing on the putevent-side
I don't get any event, and the MCC_EVENT_PUT returns with a "no
outstanding requests".
When I do a call to MCC_AES_DUMP of in_entity at the getevent-side I
get the following output:
entity [0] wild = NOT_WILD class = 700 id = 1 type = 4
instance = ..ABCD
%X010441424344
and on the putevent-side the same except for:
instance = ABCD
I.E. not the two periods and no hex-number
Is this correct and can anyone explain why the event doesn't get passed
in the latter case?.
Thanks,
Nils
|
1046.17 | One's a simple name, the other isn't | TOOK::GUERTIN | I do this for a living -- really | Fri May 24 1991 12:45 | 9 |
| The Event Manager does not consider the Entities to a match unless they
*exactly* match. In your case, the two bytes in front of the value
indicate that the value is a simple name. Simple names are not that
simple. They have a simple name type as the first byte and a simple
name length as the second byte. The Putter is not building the simple
name identifier correctly. Look in the MCC_INTERFACE_DEF.H file for
the simplename structure and possible field values (defined as constants).
-Matt.
|
1046.18 | I must be stupid, don't understand!! | STKHLM::BERGGREN | Nils Berggren EIS/Project dpmt, Sweden DTN 876-8287 | Fri May 24 1991 15:01 | 15 |
| repl .17
don't understand. What I do is :
first create a descriptor of type MCC_K_DT_SIMPLE_NAME and
initialvalue of "ABCD". And than I use that descriptor when
calling MCC_AES_CREATE. As I understand, that's the
way to do it, but I guess I've missed something, again....
The code provided for PUTEVENT in an earlier reply is not
what I describe here, but this is the way it is done now.
Can You provide me with an example on how to do it?
Thanks alot,
Nils
|
1046.19 | string vs. simple name | TOOK::CALLANDER | | Fri May 24 1991 16:31 | 4 |
| "abcd" is a string of characters, a simple name is more than that. There
is a routine mcc_dns_opaque_simplename that will convert the string
"abcd" into the internal format (that .17 was describing) that you want
to use when creating your AES spec.
|
1046.20 | What about ... | TOOK::GUERTIN | I do this for a living -- really | Fri May 24 1991 16:39 | 22 |
| RE:.18
How about
char entity_name[] = " ABCD";
entity_name[0] = MCC_K_SN_NORMAL;
entity_name[1] = sizeof entity_name - 2;
Even better would be:
MCC_T_SimpleName entity_name;
entity_name.sn_b_type = MCC_K_SN_NORMAL;
entity_name.sn_b_count = sizeof "ABCD";
strncpy( &entity_name.sn_b_sting[0], "ABCD", sizeof "ABCD" );
but note that the size of the value that the descriptor points to
is 6 bytes, i.e., 4 bytes plus 2 of overhead (mcc_w_curlen should = 6).
-Matt.
|