Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: compudj@krystal.dyndns.org (Mathieu Desnoyers)
Subject: [ltt-dev] [PATCH] Fix marker_field access in the JNI interface
Date: Sat, 11 Sep 2010 10:44:46 -0400	[thread overview]
Message-ID: <20100911144446.GA22579@Krystal> (raw)
In-Reply-To: <1284071428-23490-1-git-send-email-alexandre.montplaisir@polymtl.ca>

* alexandre.montplaisir at polymtl.ca (alexandre.montplaisir at polymtl.ca) wrote:
> From: Alexandre Montplaisir <alexandre.montplaisir@gmail.com>
> 
> Reflect the new way to access marker_field fields introduced in 1184dc3
> 
> Signed-off-by: Alexandre Montplaisir <alexandre.montplaisir at gmail.com>

merged, thanks !

> ---
>  ltt/jni_interface.c |   19 ++-----------------
>  1 files changed, 2 insertions(+), 17 deletions(-)
> 
> diff --git a/ltt/jni_interface.c b/ltt/jni_interface.c
> index 255f322..d1bd993 100644
> --- a/ltt/jni_interface.c
> +++ b/ltt/jni_interface.c
> @@ -998,20 +998,6 @@ JNIEXPORT jint JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_
>          return (jint)newPtr->type;
>  }
>  
> -/* Get of offset */
> -JNIEXPORT jlong JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_1getOffset(JNIEnv *env, jobject jobj, jlong marker_field_ptr) {
> -        struct marker_field *newPtr = (struct marker_field*)CONVERT_JLONG_TO_PTR(marker_field_ptr);
> -        
> -        return CONVERT_UINT64_TO_JLONG(newPtr->offset);
> -}
> -
> -/* Get of size */
> -JNIEXPORT jlong JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_1getSize(JNIEnv *env, jobject jobj, jlong marker_field_ptr) {
> -        struct marker_field *newPtr = (struct marker_field*)CONVERT_JLONG_TO_PTR(marker_field_ptr);
> -        
> -        return CONVERT_UINT64_TO_JLONG(newPtr->size);
> -}
> -
>  /* Get of alignment */
>  JNIEXPORT jlong JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_1getAlignment(JNIEnv *env, jobject jobj, jlong marker_field_ptr) {
>          struct marker_field *newPtr = (struct marker_field*)CONVERT_JLONG_TO_PTR(marker_field_ptr);
> @@ -1046,8 +1032,6 @@ JNIEXPORT void JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_
>          
>          printf("name          : %s\n"  ,g_quark_to_string(newPtr->name) );
>          printf("type          : %i\n"  ,(int)newPtr->type );
> -        printf("offset        : %lu\n" ,(long unsigned int)newPtr->offset );
> -        printf("size          : %lu\n" ,(long unsigned int)newPtr->size );
>          printf("alignment     : %lu\n" ,(long unsigned int)newPtr->alignment );
>          printf("attributes    : %lu\n" ,(long unsigned int)newPtr->attributes );
>          printf("static_offset : %i\n"  ,(int)newPtr->static_offset );
> @@ -1068,6 +1052,7 @@ JNIEXPORT void JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniMarkerField_ltt_
>  JNIEXPORT void JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniParser_ltt_1getParsedData(JNIEnv *env, jclass accessClass, jobject javaObj, jlong event_ptr, jlong marker_field_ptr) {
>          LttEvent newEventPtr = *(LttEvent*)(CONVERT_JLONG_TO_PTR(event_ptr));
>          struct marker_field *newMarkerFieldPtr = (struct marker_field*)CONVERT_JLONG_TO_PTR(marker_field_ptr);
> +        struct LttField *newLttFieldPtr = ltt_event_field(&newEventPtr, marker_field_get_index(newMarkerFieldPtr));
>          
>          jmethodID accessFunction = NULL;
>          
> @@ -1131,7 +1116,7 @@ JNIEXPORT void JNICALL Java_org_eclipse_linuxtools_lttng_jni_JniParser_ltt_1getP
>                                                          accessClass, 
>                                                          accessFunction, 
>                                                          javaObj, 
> -                                                        CONVERT_PTR_TO_JLONG(*(GINT_TYPE_FOR_PTR*)(newEventPtr.data + newMarkerFieldPtr->offset))
> +                                                        CONVERT_PTR_TO_JLONG(*(GINT_TYPE_FOR_PTR*)(newEventPtr.data + newLttFieldPtr->offset))
>                                                       );
>                          break;
>                          
> -- 
> 1.7.0.4
> 
> 
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
> 

-- 
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com



      parent reply	other threads:[~2010-09-11 14:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-09 22:30 alexandre.montplaisir
2010-09-10 21:35 ` Matthew Khouzam
2010-09-11 14:44 ` Mathieu Desnoyers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100911144446.GA22579@Krystal \
    --to=compudj@krystal.dyndns.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox